Home Games Projects Blog Contact Private
Network

3D On The Nokia N900 Through Head Tracking

Building on the algorithms I’ve implemented as part of my Diplom Thesis, I’ve now implemented a demo of a 3D view on the Nokia N900. The idea is to adjust the camera through which the 3D scene is viewed to the user’s head position. The screen then appears to be a window into the virtual world.

The 3D scene is easily constructed on the N900 using OpenGL ES 2.0. A small box and a few foreground objects are sufficient. In order to determine the head position I use the face detection and tracking code I’ve recently implemented (and already used for a little tech demo). The two things are easily put together and the result is this:

The method is not new:

The most difficult thing is to get the perspective right as there is a lot of conflicting information out there. Johnny Lee used the Direct3D function PerspectiveOffCenterLH, which is obviously not available in OpenGL. The best hint I found is here. There projection matrix M should look like this:

Projection matrix

Where n is the distance to the near clipping plane, f the distance to the far clipping plane, t and b define the horizontal clipping planes, l and r define the vertical clipping planes.

I think the effect is pretty cool and I’m currently contemplating making a game with it.

Share and Enjoy:
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • MisterWong.DE
  • Reddit
  • Slashdot
  • StumbleUpon
  • Technorati
  • email
  • Identi.ca
  • MySpace
  • Twitter

Tags: , , , , , , , , ,

36 Responses to “3D On The Nokia N900 Through Head Tracking”

  1. uberVU - social comments Says:

    Social comments and analytics for this post…

    This post was mentioned on Twitter by j66k: 3D view on the Nokia N900 through head tracking http://bit.ly/9O7G3A #n900 #maemo…

  2. Yngve Says:

    that is just wicked! does this mean I can get it on my N900 without the need for any peripherals? will u put an installable demo somewhere? my friends will go nuts if they see this :D
    - written on my N900

  3. Mike Says:

    This is awesome. Well done :)
    Not sure if this is possible, but you *could* try using the accellerometer data to try and smoothen out the motion which is slightly chopy. It would no doubt be slightly complicated but it might be possible and help?

  4. jfk Says:

    Thanks!

    Yngve: Yes, is works solely by using the N900’s front camera. I don’t have a demo ready (yet), but that might change sometime in the future.

    Mike: The choppiness is a result of the face detection that can be inaccurate at times due to lighting conditions and the poor quality of the N900’s front camera. I don’t see how the accelerometer data would help with that problem. While recording the video the device wasn’t moved.

  5. Mike Says:

    Ah yes, of course ;) I meant when you stay stationary and instead tilt the device left/right/up/down. Then you’d have some spatial data on how the device is situated in relation to the head (which you could still be tracking).

  6. Tweets die 3D On The Nokia N900 Through Head Tracking | Johannes "jfk" Kuhlmann's Blog erwähnt -- Topsy.com Says:

    [...] Dieser Eintrag wurde auf Twitter von Skyler, Vincent Lefèvre, Skyler Visconti, MeeGoPortal, Yngve I. Levinsen und anderen erwähnt. Yngve I. Levinsen sagte: RT @jfk: 3D view on the Nokia #N900 through head tracking http://bit.ly/9O7G3A #maemo [...]

  7. Fabio Says:

    Man, very very very cool, would you let us download this demo !? I’m from Brazil, I have a N900 and I found your project amazing ! congrats ! keep the excelent work !

  8. Andrew Flegg Says:

    Yeah, a tech demo/binary or something would be very cool, the source code even more so :-)

  9. Lennart Says:

    Wow that is great!!!
    This should be implemented in every game :P

    What kind of game do you have in mind for this?
    Can’t wait to try out a little tech demo!

  10. f2thak Says:

    wow!!!!!!!!!!!! this has so much potential!!

  11. Tlex Says:

    This is truly awesome :-)
    As soon as you have an installable demo, I will try it out straight away, just to get impressed and of course impress others :-)
    Keep up the good work.

  12. 3D Head Tracking - Effetto 3D su Nokia N900 (Video) | Says:

    [...] Fonte [...]

  13. toucan murphy Says:

    Maybe you should try the option to use the back camera and put the display on a nice big 50″ screen! :P That way the 3d will be more immersive and the camera tracking more accurate…

  14. Danilo Luvizotto (traysh) Says:

    Fantastic, congratulations!

  15. jfk Says:

    Thanks everyone!

    Mike: Now I get the idea. That might work, but it would restrict the usage to holding the device in your hands. Also, the algorithm would probably have to be calibrated as different positions might be possible.

    Lennart: Well, the easiest game would be something where you have to pick up certain objects and dodge others. The technology is probably best suited for small/casual games.

    toucan: Yes, that would also work. But then you can also directly use a normal computer with a webcam. :-)

  16. Spidey Says:

    Wow, THANKS for developing this! I was hoping to do something like that on my graduation project (diplom thesis) which will be next year. Mind sharing some info or some ideas to improve this? Maybe I could enhance your code, instead of rebuilding the wheel.

  17. maxximuscool Says:

    i thought i was dreaming about this. But this is real…. Thank you so much. Ps my N900 is happy

  18. 3D controlando el movimiento de la cabeza | Nokia N900 Says:

    [...] Fuente: http://johanneskuhlmann.de/blog/2010/04/28/3d-on-the-nokia-n900-through-head-tracking/ Únete a nuestra página en Facebook. [...]

  19. @vkvraju Says:

    WoW!! WoW!! Waiting eagerly for your game!!

  20. maluka Says:

    A tunnel shooting game would be Epic!!!

  21. Tommy Says:

    Hey

    For web browsing on small screen this feature would be great! You could easily
    scroll the screen.

    -T

  22. Faz Says:

    Amazing!!
    Download please? :)

  23. Video: Virtual Reality 3D Head Tracking on the Nokia N900 (maybe Winscape soon too?) « My Nokia Blog Says:

    [...] Props to http://johanneskuhlmann.de/blog/2010/04/28/3d-on-the-nokia-n900-through-head-tracking/ [...]

  24. Wake Says:

    Honestly I think just a game is thinking a little small. You could in theory create a development platform where people could code around your engine. Of course if you were in it for the money you could always charge for access and use of the platform engine. I may be a huge fan and advocate of open source. but I’m also realisic in my beliefs that if there isn’t money involved work will be slow if at all. I’m really looking forward to progress on this. Gj :D

  25. sean Says:

    Very nice demo. For smoothing you might want to look into double exponential smoothing – Joa LaViola has a nice paper on the application here. It’ll be faster than a Kalmen filter and will probably get you anything you need. Let me know if you try that out.

    In terms of the accelerometer, you might actual consider that if you ever plan to pick up the device. Right now, you’ve got it in a very stable location sitting on the table. Picking it up will introduce new errors that you’ll want to smooth out somehow.

  26. blair Says:

    Very cool! Are you tracking the head in full 3D, including distance from the N900, or just left/right/up/down? will this tracking code ever be available for others to use?

  27. m double u Says:

    great great great,
    i want this on my phone, how?

  28. jfk Says:

    Thanks again everyone! :-)

    Spidey: I’m not sure yet if I want to share my code. Sharing my thesis (on which this is based) itself might also be difficult because it’s in German only.
    I’d be happy to share any info you need though. Just write me an e-mail (see the contact area of this website).

    Wake: Interesting thought. Someone should test how well this approach works for different kinds of games.

    sean: There is no Kalman filter involved if that’s what you want to say. Right now I’m just taking the average of the last three detections. When I have some time I might look in that exponential smoothing.

    blair: I’m also able to roughly determine the face’s size (which obviously corresponds to the distance), but my tests showed that the size detection wasn’t stable enough. So I didn’t include it in the demo.

  29. NPZster Says:

    Plase share this demo on maemo.org! or just add a download link
    love it!!! it’s great!

  30. Fouad Daoui Says:

    You are a genius :D .. its fantastic .. i hope u publish the demo online soon so we can try it on our N900 :) its greaaaaaaaaaaaaaaaaat :) and thank you

  31. TranBach's Blog » Blog Archive » Chơi game trên N900 tuyệt vời hơn với hiệu ứng 3D Says:

    [...] Johannes’s Blog This entry was posted on Tuesday, May 18th, 2010 at 1:41 am and is filed under HI-Tech. You can [...]

  32. hardy Says:

    How does this work with two eyes? Do you take the average position to yield a view slightly off for each eye? Does it look more realistic when closing one eye, or is the difference negligible?

  33. Blooper Says:

    WOW.. I saw this on TED once, I would love to play with this and perhaps do more. :)
    Demo please.. please. please.. :) ..

  34. T.K. Says:

    Dude that is likeee the most awsome thing i have ever seen….
    Please dude share the program….
    It has been three months and i am dieing to see this on my n900….
    Nokia made the n900 compatable so that every one could enjoy it….
    and explore it their way…

    Thanks…….

  35. TiagoTiago Says:

    Make a clone of Curveball where you gotta hit the ball with your face! :D

  36. Matteo Gusmini Says:

    There is a downloadable version of this project? It’s very urgent!! Please…

Leave a Reply