6

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 ;)

Pierre
  • 10,593
  • 5
  • 50
  • 80

4 Answers4

6

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.

dabhaid
  • 3,849
  • 22
  • 30
  • Sorry for my late answer. Thanks to you ! I know concept of rotation matrices but here I not really see how to use it. – Pierre Jul 04 '11 at 15:20
  • This seems to have the same formulae: http://www.movable-type.co.uk/scripts/latlong.html, I'll update the link in the answer – dabhaid May 08 '15 at 21:21
1

The code in the iPhone ARKit project does this, and quite a bit more. While you may not be able to use their complete library, it is a great reference on the subject of augmented reality.

RyanR
  • 7,728
  • 1
  • 25
  • 39
  • 1
    I would like to understand myself math under this. Tanks for the link but I really would like to implement it myself. – Pierre Jun 28 '11 at 08:17
  • If you do get that epiphany behind the math, would you be so as to post a write back to this question? I've been trying to grasp it myself for a while – RyanR Jun 28 '11 at 13:15
  • @RyanR The link mentioned in this thread is not opening up. http://www.iphonear.org – Deepak Thakur Jan 27 '15 at 05:30
  • @Katoch It's a 3.5 year old link, I'm not surprised if the owner of the domain isn't maintaining it anymore. Some quick googling yielded https://github.com/zac/iphonearkit/ – RyanR Feb 01 '15 at 14:54
0

You can create a location based AR app in Junaio. It's an AR browser. Free to use and deploy in (as long as it's not a custom app and in Junaio).

Amanda
  • 136
  • 5
0

Check out 3DAR, it lets you add an AR view to a MKMapView app very easily. There's a video tutorial on this process, as well as some sample code, on the 3DAR site, www.3dar.us

Thomas
  • 1