While designing the mixed-reality VR systems for Valve and HTC’s VR Experience, we needed to align the virtual camera with its counterpart in meatspace (no tool yet existed to facilitate this). Out of the box this was a lengthy process of trial and error: config files had to be edited manually, followed by a reboot, and it was necessary to tell Unity where the camera is in relation to the controller and it’s field of view (FOV).
To accelerate development and create a more efficient, reusable workflow for setting up mixed-reality VR, we brought in Unity dev wunderkind Gus McManus. Gus was already developing some virtual DJ applications in Unity, so he was a perfect fit to help create the camera configurator app.
The camera configuration app allows you to interactively tweak the Unity camera object to match up with your actual physical camera. If you are developing mixed-reality VR in Unity, you probably find the camera calibration process cumbersome too, so we’ve posted the app free for you to download.
To use the Punch Drunk Unity Camera Configurator:
- Download and install.
- Fire up your compositing system so you’ve got your green screen camera view of the room composited with the game output.
- Use the keyboard controls to align the virtual camera with the real camera. (It helps to aim your physical camera at another vive controller, then match the in-game camera to it with the app.)
- Periodically moving your target controller can help sync even tighter. Translational discrepancies are most prominent when the controller is near the camera, whereas rotational discrepancies are more prominent when the controller is far.
- When you’re done, and everything looks good, the “print” option places a calibrated .cfg in a new folder on your desktop.
- Place that .cfg file in the root directory of your project (next to your assets folder or executable) and you’re ready to go!
|Move Forward||Move Backward||Move Left||Move Right||Tilt Left||Tilt Right|
|Move Up||Move Down||Rotate Left||Rotate Right||Field of View (far)||Field of View (near)|
|Up arrow||Down arrow||Left arrow||Right arrow||F||V||P|