我如何使用陀螺仪使一个“彩弹”停留在它击中增强现实应用?

时间:2021-12-08 20:16:19

As I "shoot" a paintball and it impacts, I need the impact to stay in the same relative position where it hits. I realize that I will have to specify some sort of distance factor to make this work properly.

当我“射击”一个彩弹时,它会撞击我,我需要这种撞击保持在它撞击的相对位置。我意识到我必须指定某种距离因子才能让它正确工作。

1 个解决方案

#1


4  

For augmented reality, you generally need azimuth and elevation. That can be found by using trigonometry to figure out the angles between your device and the target.

对于增强现实,通常需要方位角和仰角。这可以通过三角函数计算出你的设备和目标之间的夹角。

http://www.invasivecode.com/blog/archives/1435

http://www.invasivecode.com/blog/archives/1435

There is a simple set of code that shows how to do that. Now the big problem, which you mentioned was figuring out the distance. You could do a preset distance and figure out your azimuth and elevation that way, or another way it's possible to do would be take a picture and track the movement of that point, but that would be a bit more difficult.

有一组简单的代码展示了如何做到这一点。现在最大的问题是,你提到的是计算距离。你可以做一个预设的距离然后算出你的方位角和高度,或者另一种可能的方法是拍张照片并跟踪那个点的运动,但是那样会有点困难。

There are some development kits that offer that sort of feature, of tracking a marker in the view, but I don't have experience implementing anything like that. Here is an example using Unity3D

有一些开发工具包提供了这种特性,即跟踪视图中的标记,但我没有实现这种特性的经验。这里有一个使用Unity3D的例子

http://www.slideshare.net/aquarioverde/introduction-to-ar-with-unity3d

http://www.slideshare.net/aquarioverde/introduction-to-ar-with-unity3d

#1


4  

For augmented reality, you generally need azimuth and elevation. That can be found by using trigonometry to figure out the angles between your device and the target.

对于增强现实,通常需要方位角和仰角。这可以通过三角函数计算出你的设备和目标之间的夹角。

http://www.invasivecode.com/blog/archives/1435

http://www.invasivecode.com/blog/archives/1435

There is a simple set of code that shows how to do that. Now the big problem, which you mentioned was figuring out the distance. You could do a preset distance and figure out your azimuth and elevation that way, or another way it's possible to do would be take a picture and track the movement of that point, but that would be a bit more difficult.

有一组简单的代码展示了如何做到这一点。现在最大的问题是,你提到的是计算距离。你可以做一个预设的距离然后算出你的方位角和高度,或者另一种可能的方法是拍张照片并跟踪那个点的运动,但是那样会有点困难。

There are some development kits that offer that sort of feature, of tracking a marker in the view, but I don't have experience implementing anything like that. Here is an example using Unity3D

有一些开发工具包提供了这种特性,即跟踪视图中的标记,但我没有实现这种特性的经验。这里有一个使用Unity3D的例子

http://www.slideshare.net/aquarioverde/introduction-to-ar-with-unity3d

http://www.slideshare.net/aquarioverde/introduction-to-ar-with-unity3d