llemarie’s weblog

Programming, tinkering – Lionel Lemarié

Project: Head-tracking on PS3

Posted by llemarie on February 9, 2008

IR LED glassesThomas Miller IV from SCEA game studios posted a cool video about his Desktop VR port to the PS3 (embedded below). This is a very interesting concept and well worth watching.

It uses the Playstation Eye webcam to track IR LEDs that you wear on your head on the side of a pair of glasses. As you move your head, it moves the 3D view on the screen accordingly, giving you a great impression of depth. When you look at the face of a cube and lean left to look at its side, you actually see its side.

I built the glasses out of junk remote controls lying around. Took the IR LEDs, the remote battery compartment, even the on/off switch. Glued the lot together on my friend’s sunglasses and added a couple of wires. Job done. No resistors needed that I could tell, the IR LEDs use 1.6V, so they should be fine wired straight to a couple of 1.5V batteries in series. Post in the comments to tell me otherwise before they blow up and I’ll owe you one. I could have used button batteries to make it swish and subtle, but then it would have blown my budget of £0, so I went for the fat ones from the remote controls.

We taped developed film on the Playstation Eye as an IR filter (see photos), as recommended in the video. It works pretty well. To improve the image quality it’s recommended to open the webcam, and remove the IR filter (it’s a pale green film on the lens), but it’s not strictly necessary to do it. (Note that the IR filter inside the webcam prevents IR light from passing through, whereas our developed film tends to only let the IR light through, not sure what the proper vocabulary is there, they probably have different names).

The PS3 demo written by tmiv is pretty simple, and neat in that way. It takes the image from the webcam and looks for the two dots of light from the IR LEDs (also supports one dot for controlling using a normal remote control). As the dots move on the X/Y plane, it moves the camera accordingly, giving you the impression that you are looking on the side of the object. The effect is pretty uncanny! By using the distance between the points, it knows when you’re getting closer or further from the webcam, and changes the depth too.

Video from Thomas:

11 Responses to “Project: Head-tracking on PS3”

  1. Bonjour Lionel,

    Very interesting stuff there, the reverse of the Wii remote!

    I suggested something like this to someone way back when the SOCOM beta trials were active. At the time my idea was to stick some sticker onto the SOCOM headset and track that on the EyeToy camera 🙂 (That was inspired by the juggling at Daryl’s desk)

    Now we could all replicate your handy work and sit there playing games looking like Neo!


  2. llemarie said

    Hey James,

    Not really my handy work, I simply followed the instructions from tmiv. He gets the credits for getting this to work on PS3.


  3. chroos said

    hi there.. can u explain how you managed it to remove the ir filter.. i dont see any way to open thar lense contrucion without breaking it!

    hope u ll answer soon

  4. llemarie said

    Hi Chroos,

    I did not modify the webcam, I left the filter in. It would probably have worked better with the filter taken out, but it was good enough with no modifications.

    Have fun,

  5. jordantommy said

    I saw the head tracking movie… it’s fantastic!
    I have a PS3 with playstation eye cam, and I want to try this experience.
    Where can I download the “Head-tracking on PS3” code?
    Is it a free code source?

    Have fun,

  6. llemarie said

    Hi Jo,

    The source is released to licensed PS3 developers, I’m afraid it’s not publicly available.


  7. jordantommy said

    Hi Lionel,
    OK for the source code.
    But if I want only the executable file for try?
    Can I have this file?


  8. llemarie said

    Sorry again, the executable is for licensed developers only as well. The PS3 doesn’t run unsigned executables. You can experiment in PS3Linux, but this particular application isn’t available in Linux.

  9. jordantommy said

    Ah OK, no problem, thanks for all.

  10. lokesh said

    i need the ir glasses for one of my projects in head tracking….can u mail me the details of the making…or where to buy it….

    • llemarie said

      Hi Lokesh,

      The details are in the post: I took some normal glasses, salvaged a pair of IR LEDs from old remotes, stuck one on each side of the glasses. That’s all there is to it.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: