0

我正在制作一个用于研究目的的 VR 模拟,我需要在模拟过程中收集一些数据。如:

  • 是一个被观察的物体(所以它应该在相机的中心)
  • 如果是,查看多长时间
  • 用户看到这个对象后正在看什么对象。

我没有太多时间进行试验和错误,我需要一些指示我应该使用什么方法。

我应该在对象本身上放什么脚本,应该在相机上放什么脚本。我不需要代码块(尽管它们会有所帮助),只需要我应该使用什么以及我应该如何将所有东西放在一起的一些想法。

我正在使用 Oculus Rift,所以我知道有关相机的一些内容可能会有所不同,但我认为适用于一个相机的东西也适用于 Oculus 使用的两个相机。

谢谢!

4

2 回答 2

0

Take the vector from the camera to the object (someobject.transform.position - cam.transform.position).normalized and dot it with the camera's transform.forward direction. This, depending on the positions of the camera and the object will be a value between -1 and 1. Higher value will mean the camera is looking more towards the object, so you should compare it to some threshold. If is above the threshold you set, then you win!

于 2015-03-30T19:41:21.553 回答
0

只需简单的 Google 搜索,就有很多很好的资源。这个答案似乎很全面: http ://answers.unity3d.com/questions/8003/how-can-i-know-if-a-gameobject-is-seen-by-a-partic.html

于 2015-03-30T08:52:15.883 回答