pizthewiz / Cinder-OculusRift

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cinder-OculusRift

This is (yet another) Oculus Rift block for Cinder, and a collaboration between Paul Houx and myself. Thanks Paul for all the initial work! It is up-to-date with the 0.4.4 version of the Oculus SDK, and the latest glNext Cinder version. It has been tested with the DK2 only. Both Windows & Mac OS X are supported, although Windows (with direct-mode enabled) is still the prefered platform.

Samples

  • Basic Sample: Features the standard use case scenario, with all the most common functionalities. BasicSample

  • Spherical Stereo: Maps a sample Arnold 360 texture to a sphere, in stereo. Useful for both live-action & pre-rendered CG content. SphericalStereo

  • Instanced Stereo: Similar to the Basic Sample, only it uses instanced stereo rendering as described here.

Usage

First, initialize the rift manager in prepareSettings. Also make sure to disable framerate and msaa 16!)

hmd::RiftManager::initialize();

Create an Oculus Rift instance, and attach it to a window (with vsync enabled preferably).

hmd::OculusRift		mRift;
...
mRift.attachToWindow( app::getWindow() )

The OculusRift class has two cameras: a convenience host camera controlling the overall head position & orientation, and an active eye camera which is updated by the SDK according to the tracked position & orientation. Their transformations are composed and can be queried via the hmd::OculusRift interface.

In the draw() loop, iterate over each eye (enabling it) and draw your scene as follows:

for( auto eye : mRift.getEyes() ) {
		mRift.enableEye( eye );
		drawScene();
}

To avoid judder, make sure you hit 75fps!

TODO:

  • Add project template
  • Integrate and test Anttweakbar's GUI
  • Incorporate Oculus's VST plugin (work is already done)

About

License:Other


Languages

Language:C++ 75.7%Language:C 23.7%Language:Shell 0.6%