Augmented Reality movement

2020-08-01 00:54发布

问题:

Hey guys i am in a problem related to augmented reality please help

PROBLEM

I need to show the label on camera overlay for any object with movement for example

i have 4 object say four house in four direction i.e. south north east west and when i see to north i should be able to see the only single label for that house

on that label there will be some information say house name so how to do it

  1. when i move to south direction north label should start move aside and south label should start to come on the screen

Solution that i have done still

when i see to north i am able to show the all four label with information( but i beed to display only one)

回答1:

  1. Get a coordinate for each object using http://itouchmap.com/latlong.html, google's geocoding API, or any other means.
  2. Get heading updates from the location manager.
  3. Calculate the angle from your position to the position of each object using atan. You will find this method if you google augmented reality atan, but it's only highschool math.
  4. Find the field view of your camera. For the iPhone 3 it is 35.5 and 53.
  5. If your angle is 35.5/2 degrees horizontally around your heading, then show the object.
  6. For objects on the ground in the same city or closer you can disregard the altitude and the arc of the earth.

To move the object around you need to divide the number of pixels of the screen between the degrees of the field view to get pixels per degree, and multiply that by the offset of the object from your heading.

This is easy stuff so I wrote an example project. It is not a library, the point is to show you where to start. From there you should check existing libraries on github (arkit basically) and make more specific questions.



回答2:

Check out this tutorial: http://www.invasivecode.com/blog/archives/1435 I found it very useful. I was trying to implement a demo, sort of like this iPhone app: http://www.acrossair.com/acrossair_app_augmented_reality_browser_for_iPhone_3GS.htm

Is it what you need?