You can also let run your program in real time by using stereo view techniques. To understand how to do this, you can read some information on realtime stereo viewing here: 3D Stereo Rendering Using OpenGL (and GLUT).
There are some examples how it will looks like in real time (rendered with OpenGL in widescreen mode 16:9)
![]()
![]()
![]()
Here is a list of steps (in my own words) on how to do stereo view (not only for 019):
// Calculate some variables
float halfEyeSeparation = eyeSeparation / 2;
float ratio = float(viewPortWidth)/float(viewPortHeight); //use your vieport settings (for 019 better use 1280x1028)
float radiance = DEGTORAD * fieldOfView / 2; //DEGTORAD = (PI / 180.0f)
float wd2 = nearPlane * tan(radiance); // nearPlane is the near plane of your view frustum
float ndfl = nearPlane / focalLength;
// Calculaions for right eye
float left = -ratio * wd2 - 0.5 * eyeSeparation * ndfl;
float right = ratio * wd2 - 0.5 * eyeSeparation * ndfl;
float top = wd2;
float bottom = -wd2;
// Use OpenGL to calculate projection matrix
glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity();
glFrustum(left,right,bottom,top,nearPlane,farPlane);
glGetFloatv(GL_PROJECTION_MATRIX, asymmetricProjectionRight); // store projection matrix for right eye in float[16] array
// Calculation for left eye
left = -ratio * wd2 + 0.5 * eyeSeparation * ndfl;
right = ratio * wd2 + 0.5 * eyeSeparation * ndfl;
top = wd2;
bottom = -wd2;
// Use OpenGL to do calculations for us
glLoadIdentity();
glFrustum(left,right,bottom,top,nearPlane,farPlane);
glGetFloatv(GL_PROJECTION_MATRIX, asymmetricProjectionLeft); //store projection of left eye
// Return back to modelview matrix mode
glPopMatrix();
glMatrixMode(GL_MODELVIEW);
glViewport(0,0, 1280, height)) glMatrixMode(GL_PROJECTION);
glLoadMatrixf(asymmetricProjectionLeft);
glMatrixMode(GL_MODELVIEW);)glViewport(1280,0,2560,height))You can also download cCamera-class and let cCamera do this work for you :-)
This class also provides some more useful methods: for example frustum culling. You are free to use it in your applications.
After fiddling around with mplayer and X on the computer francium in the presentation room, I should now be possible to generate MPEG2 stereo movies for presentation in 019.
The advantage of it, to having the real application running, is that you can create a voice-over, background music and, especially, that you can pre-create 25 fps animations from non-realtime applications.
An interesting idea would also be to generate two versions of important presentation footage, one in mono for conference submission, the other one in stereo for 019 !
The encoder requires the following as input:


These are the commands that I currently use:
For encoding I utilize the MJPEGTools, with the special --no-constraints to achieve resolutions above HDTV:
png2yuv -j %08d.png -I p -f 25 -b 1 | mpeg2enc --no-constraints -f 3 -q 3 -b 10000 -o out.m2v
For playback:
mplayer -fs -screenw 2560 -screenh 1024 -vo xv -loop 0 out.m2v
mplayer -vo png {movies}
in dirs called links/ and rechts/ cd into links/, thenfor a in *.png; do convert $a ../rechts/$a +append /usr/tmp/gernot/$a.png; done
Let me know (well in advance ;) ) if you want to generate some footage.