iOS augmented reality with compass and location

Pierre picture Pierre · Jun 27, 2011 · Viewed 8.7k times · Source

I'm trying to develop a mini "Around Me" like using camera, compass and location. I would like to display place's images on my screen. For the moment I have my location and my orientation with compass. I would like to know how can I determine the position of the place I want to display.

Thanks for your help ;)

Answer

dabhaid picture dabhaid · Jun 28, 2011

Once you have relative distance and bearing, which you can determine from two points in the same coordinate space using algorithms found on this page, figuring out where a known coordinate is with respect to a known viewpoint is basically a perspective projection, the math is outlined on this Wikipedia article. The rotation of the camera is given by the compass, and the tilt by the accelerometer (the position is of course, GPS).

I'm trying to find a better document - there are a couple of extra things to consider - like the camera parameters etc, but this is a good starting point.

If it's too involved (like if you're not comfortable with rotation matrices) we can break it right down to the simple trig.