Stereoscopic 'off-axis' orthographic projection?!

Hi, I’m a vision neuroscientist using OpenGL to program stereoscopic (binocular) visual stimuli for my experiments.

My question is: is it possible to use the ‘off-axis’/‘asymmetric frustum’ method to create stereoscopic images with orthographic projection, or must stereo orthographic projections always use the ‘toe-in’ method?

If you need clarification on what I mean by these terms then see Paul Bourke’s page. The illustrations on this page show how both ‘off-axis’ and ‘toe-in’ methods can be used to create stereo images with perspective projections. However, I need to use orthographic projection.

My suspicion is that it’s not possible to use the off-axis method with orthographic projection, since an asymmetric orthographic frustum would produce exactly the same projection as a symmetrical orthographic frustrum. I haven’t been able to find any mention of off-axis orthographic projection anywhere, which suggests that it can’t be done, but I’d like confirmation of this.

Many thanks in advance,
Aidan

Neither of those are an orthographic projection.

And yes, you can do either (the correct or incorrect stereo perspective approach) with standard MODELVIEW and PROJECTION matrix settings. For off-axis projection setting, use glFrustum with l != -r and/or t != -b

To add to the previous post:

If you only modify the left/right your ortho frusta do not converge. If you need them to converge, you can add shearing to your MODELVIEW matrix. I recently implemented this here: http://www.equalizergraphics.com/cgi-bin/viewvc.cgi?view=rev&revision=5464

Thank you both for your replies. You’re correct that the link I gave in my previous post only shows illustrations of toe-in and off-axis perspective projections. The equivalent orthographic projections would look something like this:

I beleive that the toe-in othographic projection is what I’m current using. My object is centred at the origin (0,0,0) and my ‘camera’ always points to the origin, so I get an orthoghraphic projection from each eye’s point of view.

Stefan, is this what you mean by my frusta not converging? By shearing, are you referring to something similar to what is going on in the ‘off-axis orthographic’ diagram? I’m currently using OpenGL via Psychtoolbox for MATLAB (highly not recommended!), so I just wanted to check that your code does what I think it does at a theoretical level before I try digging into it.

I have a portion of code that creates a stereographic rendering of my scene. It does this by offsetting the whole scene left and right which does not change where the camera is aiming, this creates an off-axis projection.


if (stereo.enable) {
   glColorMask(GL_FALSE, GL_TRUE, GL_FALSE, GL_TRUE);
   matrix.Push();
      matrix.Translate( cos(transform.yRot) * 0.25, 0.0, sin(transform.yRot) * -0.25);
      drawScene();
   matrix.Pop();

   glColorMask(GL_TRUE, GL_FALSE, GL_TRUE, GL_TRUE);
   matrix.Push();
      matrix.Translate( cos(transform.yRot) * -0.25, 0.0, sin(transform.yRot) * 0.25);
      drawScene();
   Core::matrix.Pop();
}

After adding perspective to the scene I get something like this:

If I understand the concept of off-axis ortho correctly, then adding a shear instead of perspective will accomplish this, as eile mentioned above. This should achieve something like this:

Not quite. Toe-in frusta have convergence, but are an approximation of the correct frusta. What I mean are two parallel cuboids which never converge (your first picture without shearing).

Yes, exactly.

yes it is possible i’ve done it before
You just need to create a custom projection matrix for it.

I’d avoid the toe in method, it’s pretty lame. You create depth problems in the scene.