Stereo Pair Generation & Viewing

Rough Outline

  1. Background: Depth Perception & Stereo

    In particular, make sure you understand the notions of "parallax" and "homologous points", especially horizontal and vertical parallax of homologous points.

    Also note that stereo pair generation only makes sense when using perspective projections.

  2. View Generation for Left and Right Eyes, using separation between eyes = d. There are at least three approaches, none of which models the actual human vision system exactly:
    1. Method 1: Two mc_ec matrices: (left eye + common center), (right eye + common center); standard perspective matrix, ec_lds
      • Sometimes called "toe-in".
      • This is often described as an "incorrect approach" since it introduces vertical parallax of homologous points (i.e., homologous points that differ in the y as well as in the x direction.) Users report eye strain after viewing such displays for a period of time.
    2. Method 2: Two mc_ec matrices: (left eye + left center), (right eye + right center); standard perspective matrix, ec_lds
      • We require (left eye - left center) == (right eye - right center); i.e., the left and right eye images have parallel primary lines of sight. Hence the upper left 3x3 submatrices of the two mc_ec matrices are identical.
      • There will be only horizontal – but no vertical – parallax of homologous points using this method.
      • Some authors describe this as the "correct method".
    3. Method 3: Common mc_ec; left eye ec_lds derived from projecting points to an eye at (-d/2, 0, 0); right eye ec_lds derived from projecting points to an eye at (d/2, 0, 0)

      As with the previous method:

      • There will be only horizontal – but no vertical – parallax of homologous points using this method.
      • Some authors describe this as the "correct method".

    Visual parallax comparisons:

    Matrix comparisons: Let us define M = ec_lds * mc_ec, and then let Mleft and Mright be the resulting left eye and right eye matrices. Then:

    1. In method 1, all 16 elements of Mleft differ from those of Mright. This is the algebraic reason why we get vertical parallax. (It is also easy to understand geometrically why we get vertical parallax since there are two different projection planes intersecting in a vertical line parallel to the EC y-axis.)
    2. In method 2, only the element in the fourth column of the first row in Mleft and Mright differ. Thus, only the LDS x coordinates of homologous points will differ.
    3. In method 3, the entire first row of Mleft differs from that in Mright. The other three rows of the two matrices are identical, however, hence it is still the case that only the LDS x coordinates of homologous points will differ.
  3. General Guidelines

    There have been many published guidelines on how the stereo parameters should be set as well as strategies for optimal placement of the objects in a scene inside the view frustum. For example:

    1. The eye separation should be approximately 1/20 of the distance from the eye to the projection plane. In terms of our viewing parameter naming conventions, this guideline suggests that we set the separation, d, to be -ecZpp/20.
    2. No part of the scene should lie in the portion of the view frustum closer than 1/2 of the distance from the projection plane to the eye.
    3. Avoid having portions of the scene in the parts of the left eye frustum that are not also in the right eye frustum, and vice versa.
  4. Device-Specific Guidelines

    It is not unusual for specific stereo-capable viewing systems to have unique optimal viewing conditions.

    1. Mechdyne's suggestions for viewing in their "mini-CAVE" state that the best viewing experience is obtained if you are standing (not sitting) roughly six feet in front of the screen. In their environment, you will observe separation of left and right images as you either lower your eyes (e.g., as you sit down) or as you move closer to the screen.
  5. OpenGL APIs and Structures
    1. You must create a Rendering Context that supports stereo. In GLFW, you do: glfwWindowHint(GLFW_STEREO, GL_TRUE) before the glfwCreateWindow call. (The glfwCreateWindow call will fail if you are not running on a platform that actually supports stereo view generation.)
    2. In addition to the GL_BACK (and GL_FRONT) buffers used in double buffering, there are GL_BACK_LEFT and GL_BACK_RIGHT buffers (and the corresponding "front" ones). You then draw the scene twice, once for each eye. Use glDrawBuffer to tell OpenGL which buffer you are targeting when rendering the scene. After drawing the scene for each eye, calling glfwSwapBuffers swaps both the left and right buffers simultaneously.