Monday, September 2, 2013

Wearing the Oculus Rift at PAX Prime 2013

This entry is very much about the Oculus Rift, but it will take a slight detour to get there.

When I make 'cool plans', I try not to talk too much about them, because based on past experience I feel that the more I talk about a cool idea, the less likely I am to actually follow through on doing it.  To that end I haven't written much up to now on my costume plans for PAX 2013.


I've been developing a number of ideas with which I can use the Oculus Rift, but one of them was to mount a webcam with a wide angle lens onto the Rift, and connect both to a small portable computer to provide pass-through vision, and integrate the whole setup into a costume for PAX.  Eventually I struck on the idea of doing a mashup of the titular character from Dr. Horrible's Sing-Along-Blog and the general character design from Tron Legacy.  I really like the across the chest costume design of the lab-coat from Dr. Horrible, and I love the whole art direction and design of Tron Legacy.

The initial sketch of the costume looked like this:

It's a simple approach compared to the design of the costume for the main character.  This is intentional; the main character is wearing armor specifically built for arena combat.  The much simpler lines of my design are intended to reflect the more 'civilian' designs seen in the background of the bar scene and to evoke the simple lines of the coat design from Dr Horrible:


There were a lot of features I thought of that would have been neat to add but which ultimately didn't make the final design.  There were also compromises I ended up making simply because this was my first attempt at cosplay, because I have a full time job, and because I don't always have the best time management skills.  Indeed, the costume wasn't ready for the first or second day of PAX.

However, I worked late on Saturday going into Sunday morning and today I finally felt I had something ready to wear:


That's me in my costume with Jerry Holkins, co-creator of Penny Arcade, PAX and Child's Play. The most satisfying thing about this picture to me is that he spotted and engaged with me, because I was wearing the Rift on my face while walking down the hall in full costume.  I mean, I'm no Batou, but based on the reactions I was getting it still must be pretty startling to see someone walking around who clearly isn't perceiving the world through ordinary means.  My co-blogger Alex is holding the camera.

See, the reason I was up so late last night was that I was trying to get fully set up so that I could actually wear the webcam and pass through vision to the Rift.  The Rift was taking the place of the goggles on the Dr Horrible design, and while they spend over 99% of their time sitting on NPH's forehead, I felt I had to wear the Rift covering my eyes.  I suspected that on my forehead the Rift just becomes a funny hat, but wearing it over my eyes produces a wow moment.  I was not wrong.

The software itself was less complex that I'd anticipated, especially since for my use case I didn't need to concern myself with head tracking at all.  In fact, my 'distortion shader' does almost no distortion.  The webcam I'm wearing actually has a magnetically attached fisheye lens.  The barrel distortion produced by the lens is close enough to an inverse match of the pincushion distortion introduced by the lenses of the Rift that all I was required to do was a little scaling.  The bulk of the work I had to do last night actually involved getting the whole system working on the Raspberry Pi I was going to be wearing, which in turn was mostly limited by the compilation speed of the Pi.  I also ended up being a bit more limited by the hardware of the Pi than I expected, being forced to sample the webcam at 320x240 resolution, even though it's capable of a full 1280x720.

I plan to cover the process of developing the code in greater detail in a later post, and the development of the costume as well, though perhaps on another blog where it's content isn't likely to be quite so off topic.  For now I'll simply provide a link to the latest version of the code located on GitHub.  I would also be remiss to end without offering my eternal gratitude to my wife Kat and her mother Kesten, without whose assistance this costume would almost certainly never have happened.

4 comments:

  1. Wow man that's genius! good stuff!!!

    ReplyDelete
  2. Hey, I am having trouble compiling the code that you uploaded.

    I am using the raspberry pi terminal and using "g++ App.cpp ........etc...etc... -o oculus" but I am getting like 20 fatal errors (probably my error)

    it says that : EGL/egl.h no file found in directory

    and it has a list of them that aren't found in the directory. (sorry I am an ultra noob).

    Could you show me how to compile the program or upload the compiled version? That would be SUPER awesome!

    Thanks a million!

    ReplyDelete
  3. Oh and one other thing, I am not sure if you know but raspberry pi has its own camera:

    http://www.mcmelectronics.com/product/RASPBERRY-PI-2302279-/28-17733

    It hooks up to a special connector on the board. If you use that instead of USB (usb is very slow) you can stream live 1080p or 720p through the C++ I believe. (that is my current setup).

    ReplyDelete
  4. Hi,
    I'm trying to run your code and i get the error libEGL warning: DRI2: failed to authenticate and libEGL warning: DRI2: xcb_connect failed. Do you now what's wrong?

    Regards Vikor

    ReplyDelete