Problems with rotation transforms for stereo views:
There are some significant problems with the rotation method. First,
the image produced for each eye is valid for only for a direct perpendicular
view, and does not account for perspective distortions that are different
for each eye. Second, the equations are only valid if the viewer is looking
directly at the center of the display window, and is positioned along the
centerline of the display window. The result of these two effects is that
rotational views, as described by SIGGRAPH, are actually not physically
correct. It also means that perspective effects differ for each eye, and
will display corresponding points for each view on different horizontal
positions. This produces poor stereo results and significant eye strain,
especially when viewing away from the center of the screen. Another problem
with rotational transforms is that front and back clipping planes will
not clip the two views equally. This can result in some object fragments
being displayed for only one eye.
Advantages of Shear transforms:
Shear transforms are less physically accurate, but are appropriate
for a viewer looking at any part of the display. Equivalent points will
be on the same horizontal line, and clipping planes will work the same
for both views. Another result of shearing is that left and right views
of objects are more similar. Even though this is an inaccurate representation,
it improves stereo perception. In real life, details at the left or right
edge of an object will be visible by only one eye. Our brains learn to
ignore such artifacts. Even though this situation is realistic, it detracts
from stereo perception.
Exact approaches:
It is certainly possible to create an exact transform, accounting for
left/right screen parallax differences, and may be fairly easy. Still,
you will have problems of unequal Z-clipping, and will need the viewer
to remain centered on the screen. Some experimental stereo viewing systems
actually track the viewer; this could enable dynamic adjustment of the
parallax corrections, allowing for proper implementation of the perfectionist
approach. Personally, I'll stick with shear transforms and avoid all the
hassle.
Here is a summary of the rotation and shear methods:
Where angle is the inverse tangent of the ratio between the fusion distance and half of the interocular distance.glMatrixMode(GL_MODELVIEW); glLoadIdentity(); /* the default matrix */ glPushMatrix() glDrawBuffer(GL_BACK_LEFT) glTranslatef(-IOD/2.f, 0, 0) glRotatef(-angle, 0.f, 1.f, 0.f) <viewing transforms> <modeling transforms> draw() glPopMatrix(); glPushMatrix() glDrawBuffer(GL_BACK_RIGHT) glTranslatef(IOD/2, 0., 0.) glRotatef(angle, 0.f, 1.f, 0.f) <viewing transforms> <modeling transforms> draw() glPopMatrix()
glMatrixMode(GL_MODELVIEW); glLoadIdentity(); /* the default matrix */ glPushMatrix() glDrawBuffer(GL_BACK_LEFT) m={1,0,sin(angle),-sin(angle)*FD, 0,1,0,0, 0,0,1,0, 0,0,0,1} glMultMatrix(m) <viewing transforms> <modeling transforms> draw() glPopMatrix(); glPushMatrix() glDrawBuffer(GL_BACK_RIGHT) m={1,0,-sin(angle),sin(angle)*FD, 0,1,0,0, 0,0,1,0, 0,0,0,1} glMultMatrix(m) <viewing transforms> <modeling transforms> draw() glPopMatrix()