Hi, I'm trying to get the Rift view working with Coin3D, based on an "old" example by jherico.
Basically I'm building a simple Coin scene with a perspective camera, light and cube that I render with SoSceneManager. Also I replaced the GLFW window with a QGLWidget, but kept the original OpenGL Cube for comparison.
The rendering of the Coin scene happens in renderScene() with SoSceneManager->setViewportRegion(vpRegion); SoSceneManager->render(false, false);
In the original example, a shader named Simple.vs/Simple.fs is used to color the sides of the cube and correct its position/rotation for each eye, by calculating the translation*rotation matrix and setting gl_Position to it.
Also I'm setting the heightAngle, aspectRatio, nearDistance and farDistance of the camera, according to the values used in the example.
Unfortunately this doesn't create the results I was hoping for. Coins Cube is too wide apart so the two images won't align properly when viewed through the rift.
Anyway here's some quick & dirty (less quick and more dirty) adaption of Example00.cpp: http://pastebin.com/tLPeGap2
I'm in no way a Coin expert, so I'm sure that there are many better ways to do this, but I decided to stick closely to an already working example, because I realized from a previous attempt, that debbuging a slightly off view is a nightmare.
In the process of integrating the Rift into FreeCAD (http://freecadweb.org/) I port the example to the DK2 and the SDK 4.2. Also there is some position and light handling added and some bug fixes.