Oculus Rift Unity Integration Documentation
Matthew Joyal Preethi Chimerla Nirav Sharda
The aim of this project is to demonstrate a pit using oculus rift and unity game engine. This document shows the steps to build this project.
1) Oculus Rift Integration in Unity4 pro:
Oculus Rift has a very easy integration with Unity for Windows and MAC OS. You need to make a free account at oculus.com and download the oculus runtime for Windows or Mac. You also need to download the Oculus Unity Integration file. Import the Oculus Unity Integration by dropping it to the asset folder in Unity and then clicking import. Now you have to add the OVR Player Controller from the prefab folder to the scene. When you are done with the scene, build it using File-> Build Settings. Then go to the folder where you saved the build and run the direct to rift exe file. This link demonstrates how to make a basic scene and run it with oculus rift.
2) Making the Scene in Unity:
First we build a room with a plane and walls on three sides using basic cubes. The fourth wall is not inserted because we want to add a spiral staircase which serves as a pit. The room has some object like bed, tables, chairs, television, piano etc which are free assets downloaded from the Unity Asset Store. Some snapshots of the room are shown below:
Figure 1: Snapshot of the room in unity.
3) Importing a model file from Blender (www.blender.org)
Unity 3d has native support for blender files. Meaning you can create a custom model in Blender (in our case the pit room seen below) and then take the .blend file and drag and drop it into your Assets in Unity. By doing this you also get access to any materials that were applied in Blender. Another approach is to export to a .fbx file from Blender.
Figure 3: Pit room imported from Blender
4) Changing IPD,FOV and other values at runtime:
The following table shows the keys to be pressed to change the values of IPD, FOV,rotational and speed scale multipliers etc.
Inter Pupillary Distance
Field of View
Update Neck Position