当我“射击”彩弹并撞击时,我需要撞击保持在它击中的相同相对位置。我意识到我必须指定某种距离因子才能使其正常工作。
1 回答
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
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
http://www.slideshare.net/aquarioverde/introduction-to-ar-with-unity3d