Mirrorshades project – Oculus Rift, 2x PlayStation Eye cameras, Unity

Continuing my cross reality research, I’m working on an Oculus Rift project to allow you to switch/fade between your real surroundings & virtual surroundings. I’m using 2x PlayStation Eye webcams (cheap, 60fps, easy to fit with standard M12 lens mounts so you can use all sorts of different lenses – I’m using 2.5mm lenses atm) attached to the Rift via a 3D printed mount & with Unity on the software end using code from this chap (Japanese link) because Unity’s WebCamTexture doesn’t work with 2x identical cameras.

IMG_20131112_173613

The mount comprises the clip designed by the guys at USC Information Technology Services (& freely downloadable from their website) with a second piece I designed & glued onto the front with epoxy. I found an EAGLE board file for the webcams so was able to design this second piece with channels matching the PCB mounting holes, allowing the webcams to be moved horizontally to experiment with different interpupillary distances (or even to completely remove one camera & simply position the remaining one in the centre).

IMG_20131112_173813

One of the cameras has to be upside down because the width of the top of the PCBs (where the mic array is) means that they can’t be placed close enough together when they are both the same way up! The image from the upside-down camera is just rotated in software.

IMG_20131112_182603

IMG_20131112_160240

IMG_20131112_173718

13 thoughts on “Mirrorshades project – Oculus Rift, 2x PlayStation Eye cameras, Unity”

  1. what software are you using to get it to display for the webcams?
    I want to do the same thing, but for FPV for my robotics.

  2. Hey! What you are doing is awesome! I am trying to archive the same thing but Im pretty new to unity and hardware stuff. Can you please point me to some direction? Any help is appreciate!

    1. What in particular do you need help with? If you want to learn the basics of Unity then there are some great tutorials/guides on the official website, some of which tie in with the ‘Angry Bots’ demo project that is included with all Unity installations.

      http://unity3d.com/learn

      For hardware stuff it really depends what it is you’re doing. This project doesn’t really involve any electronics (in terms of soldering, circuit design, etc.) just simple 3D printing & dismantling/assembling things.

  3. Hey :)
    Thats a very interssting project.
    How did you realise the prewarping of the two webcam images for the Rift?

    1. The webcam feeds are handled by 2x Unity WebcamTexture (http://docs.unity3d.com/ScriptReference/WebCamTexture.html) applied to a pair of Plane GameObjects that sit in front of the in-game cameras, so all of the warping is just done by the usual OVR prefabs. I started out trying to use GUI Texture (?) but ran into serious issues so just went with the Plane approach. I know it’s probably not the best solution, but it works :)

  4. Super cool stuff! Trying to do this myself but am getting the error that the cleyemulticam.dll is not found. Any other tricks involved? I created a new project and imported the unitybuild file from that Japanese site. I’ve installed the CL eye driver and SDK but haven’t purchased anything from them. Any help would be great :)

    1. I repeatedly ran into the same problem & in the end that was the primary reason I switched to a different pair of webcams (see http://cjdavies.org/?p=2010). Some days Unity would see the DLL with no problems, other days I would spend hours uninstalling & reinstalling/restarting before it would randomly start working. I tried without success (even resorting to Dependency Walker) to find the source of the problem but couldn’t, nor could I get it to fail reproducibly!

      That said, I haven’t tried it with Unity 4.5 but I wouldn’t hold out hope ;)

      1. Thanks for the feedback! So I eventually got this working at 2am by downgrading my unity version to 4.1. After a reboot it magically detected the dll. It took a couple more restarts of Unity to get both cameras to feed simultaneously. Definitely some buggy drivers or something going on here (glad I didn’t purchase anything from code labs). So I see you moved on to the Logitech cameras, are you able to access both without a 3rd party DLL? Aren’t they displaying with the same name and a length of 1 like the PS3Eye would before the CL eye drivers? It would be nice if I could just use webcamtexture without all of this other garbage. Keep up the good work!

        1. The pair of Logitech C310 work perfectly with webcamtexture with no messing around, which was a refreshing change from the PS3Eye cams! Without installing any drivers (on Windows 7, at least) the array of cameras contains 2 entries, one called ‘Logitech HD Webcam C310’ & the other called ‘Logitech HD Webcam C310 1’ (note the 1 at the end). They even seem to always be in the same order too, as I haven’t had to update which one is ‘left’ & which is ‘right’.

          1. Awesome to hear! Wish I would have seen this before I spent so much time getting those PS3Eye cams working. A lesson to anyone reading this, avoid the noid!

  5. Hi!
    Wonderful project!
    Can you tell me the dimensions of the planes in front of the cameras?
    And I’m also curious about the delay.
    Is an acceptable value or there’s a nausea behind the corner? :)
    Leo

    1. The dimensions of the planes depends on the distance you have them from the cameras. Having them very close means you don’t get issues where terrain can come between the planes & the cameras, so I have them 0.2 away from the cameras (I think I remember there being issues with my occlusion culling settings if I made them any closer).

      At that distance, a scale of 0.04×0.03 on a plane object gives a suitable size. The left & the right planes also need to be shifted slightly left & slightly right respectively (0.02 for me).

      With the Logitech C310 webcams (see later posts) the delay is obviously there but didn’t cause nausea in myself or any of my participants. That said, none of the people who tried the system experienced nausea when using the regular Rift without the webcams – I imagine if somebody is prone to nausea with the Rift that the added delay from the webcams would make it much worse.

Leave a Reply to Wade Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.