2
votes

I'm trying to build an Augmented Reality Demonstration, like this iPhone App: http://www.acrossair.com/acrossair_app_augmented_reality_nearesttube_london_for_iPhone_3GS.htm

However my geometry/math is a bit rusty nowadays.

This is what I know:

  • If i have my Android phone on the landscape mode (with the home button on the left), my z axis points to the direction I'm looking.

  • From the sensors of my phone i know what is the angle my z axis has with the North axis, let's call this angle theta.

  • If I have a vector from my current position to the point I want to show in my screen, i can calculate the angle this vector does with my z axis. Let's call this angle alpha.

So, based on the alpha angle I have a perception of where the point is, and I'm able to show it in the screen (like the Nearest Tube App).

This is the basic theory of a simple demonstration (of course it's nothing like the App, but it's the first step).

Can someone give me some lights on this matter?

[Update]

I've found this very interesting example, however I need to have the movement on both xx and yy axis. Any hints?

2
What is the question here? You seem to understand the process - are you just asking how to use trig to calculate alpha and theta? - BlueRaja - Danny Pflughoeft

2 Answers

2
votes

The basics are easy. You need the angle between your location and your destiny (arctangent), and the heading (from the digital compass in your phone). See this answer: Augmented Reality movement There is some objective-c code down there that you can read if you come from java.

1
votes

What you want is a 3d-Space-Filling-Curve for example a hilbert-curve. That is a spatial index over 3 ccordinate. It is comparable to a octree. You want to store the object in that octree and do a depth-firat search on the coordinate you have recorded with your iphone as fixed coordinate probably the center of the screen. A octree subdivde the space continously in eigth directions and a 3d-Space-Filling-Curve is an hamiltonian path through the space which is like a fracta but it is clearly distinctable from the region of the octree. I use 2d-hilbert-curve to speed search in geospatial databases. Maybe you want to start with this first?