Augmented Reality on Android

Sometimes my work is good to me, and I get to play with really cool stuff. Right now, I’m working on some Augmented Reality app for a client. While there’s not much to show off yet, at least there are some cubes hanging in mid-air in my room. When viewed through the phone’s camera, that is:

So far it’s been a blast, and quite fast to get right, despite some cursing and swearing. But the hard problems are solved, now it’s just a question of hooking this up to the rest of the app, which will provide the real objects to display and their positions.

Reblog this post [with Zemanta]

  • http://esceptico.org Sebastian

    Cool app, how did you translate “real world” coordinates to opengl? did you use quaternions for the rotations?

    • http://www.unwesen.de/ unwesen

      Thanks!

      Translating “real world” coordinates to OpenGL: you know the user’s position in latitude and longitude, and each object’s position in the same. Then, X and Z coordinates for an object can be calculated by taking the latitude of the user’s and an object’s, imaging a circle around the Earth that goes through them, and calculating the arc length of the arc bounded by the latitude values. Do the same for longitude, and you have your two coordinates, always assuming that your world origin at 0,0 is the user’s position. There’s no real concept of a camera position in this, just camera orientation.

      Yes, for camera and object rotations I’m using quaternions.