Rotating a scene relative to the screen

I have an OpenGL app that displays a mesh/heightfield. I am making images suitable for viewing with the old 3D red and blue glasses by;

  1. Generate the mesh.
  2. “Red scale” the image. ie gray scale but leaving red components in tact.
  3. Rotate the view a degree or 2 around the Y axis.
  4. Generate the mesh.
  5. Blue scale the image.
  6. Combine the red and blue images.

The 3D effect is very effective, but only when the mesh is lying relatively flat on the “floor”, ie X and Z axis plane.

The problem arises when the mesh is rotating around all the axiis. Then rotating around the Y axis ruins the 3D effect. So I need to now how to rotate the current scene (no matter what orientation) relative to the monitor screen Y axis.

I only use GL and GLU, so if possible I would like a non GLUT or AUX solution. Any ideas/tips?


Maybe this paper gives you another way to render your stereo view:


I’m far from being an expert on the subject but I find it quite interesting.
Correct me if I’m wrong but why not changing the point of view with a function like gluLookAt instead of rotating the scene? It seems simpler to me in order to simulate the displacement between the two eyes.


Never seen or heard of ChromaDepth before. Don’t have the glasses either. I would need to shade the mesh according to distance from the camera. Interesting method to try if I had the glasses.


I am currently using EyeX,CenterX,RotateX, etc settings to change the view of the scene. glulookat may work, but I still have no idea of calculating the coords to use with glulookat.