writing stereoscopic software - bob akka

Upload: sunu-wibirama

Post on 04-Jun-2018

224 views

Category:

Documents


0 download

TRANSCRIPT

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    1/43

    Writing Stereoscopic Software for StereoGraphics Systems

    Microsoft WindowsOpenGL

    By Bob Akka StereoGraphics Corporation August 13, 1998

    www.stereographics.com

    Copyright 1998 StereoGraphics Corporation; All Rights Reserved.

    Introduction | Hardware | Initializing a Window | Writing Buffers | Stereo Persective

    Projections|Assymetric Frustrum Projections|Camera Offset|Aesthetics|Above-Below

    Stereo|Ponts to Remember|Resources

    1. IntroductionNew PC graphics cards which include built-in support for stereoscopic buffering, along with a

    standardized OpenGL interface to those cards' stereo support features, now make it easier

    than ever to add stereo support to PC Windows-based applications. Another big advantage of

    these new stereo OpenGL graphics card implementations is that applications are now free to

    display 3D graphics elements stereoscopically without having to fill the entire screen, and incombination with other non-stereo windows and interface elements.

    Stereo OpenGL buffering is supported by Microsoft Windows NT 4.0 and later. Windows 95

    (Service Pack 2) and later also support stereo OpenGL buffering, though, in some cases,

    board manufacturers only provide stereo support with their Windows NT drivers.

    This document covers the steps that you need to take to:

    Set up for stereo development,

    Query the graphics hardware for stereo buffering support,

    Enable stereo buffering in a display window,

    Write to separate stereo buffers,

    Do stereo perspective projections, and

    Set up your projections for excellent stereo image quality.

    We strongly recommend that you also obtain "OGLPlane", a very simple stereo example

    program that illustrates most of the concepts that are discussed in this document. The

    "OGLPlane" source code and executable files are available from StereoGraphics.

    Finally, this document will discuss Above-Below stereo formatting, which is used with some

    CrystalEyes and Z-Screen hardware implementations, and which does not require a

    http://www.stereographics.com/support/developers/pcsdk.htm#1#1http://www.stereographics.com/support/developers/pcsdk.htm#1#1http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#3#3http://www.stereographics.com/support/developers/pcsdk.htm#3#3http://www.stereographics.com/support/developers/pcsdk.htm#4#4http://www.stereographics.com/support/developers/pcsdk.htm#4#4http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#6#6http://www.stereographics.com/support/developers/pcsdk.htm#6#6http://www.stereographics.com/support/developers/pcsdk.htm#6#6http://www.stereographics.com/support/developers/pcsdk.htm#7#7http://www.stereographics.com/support/developers/pcsdk.htm#7#7http://www.stereographics.com/support/developers/pcsdk.htm#7#7http://www.stereographics.com/support/developers/pcsdk.htm#8#8http://www.stereographics.com/support/developers/pcsdk.htm#8#8http://www.stereographics.com/support/developers/pcsdk.htm#8#8http://www.stereographics.com/support/developers/pcsdk.htm#9#9http://www.stereographics.com/support/developers/pcsdk.htm#9#9http://www.stereographics.com/support/developers/pcsdk.htm#9#9http://www.stereographics.com/support/developers/pcsdk.htm#9#9http://www.stereographics.com/support/developers/pcsdk.htm#10#10http://www.stereographics.com/support/developers/pcsdk.htm#10#10http://www.stereographics.com/support/developers/pcsdk.htm#10#10http://www.stereographics.com/support/developers/pcsdk.htm#11#11http://www.stereographics.com/support/developers/pcsdk.htm#11#11http://www.stereographics.com/support/developers/pcsdk.htm#11#11http://www.stereographics.com/support/developers/pcsdk.htm#11#11http://www.stereographics.com/support/developers/pcsdk.htm#10#10http://www.stereographics.com/support/developers/pcsdk.htm#9#9http://www.stereographics.com/support/developers/pcsdk.htm#9#9http://www.stereographics.com/support/developers/pcsdk.htm#8#8http://www.stereographics.com/support/developers/pcsdk.htm#7#7http://www.stereographics.com/support/developers/pcsdk.htm#6#6http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#4#4http://www.stereographics.com/support/developers/pcsdk.htm#3#3http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#1#1
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    2/43

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    3/43

    if you are interested in the Above-Below method of supporting stereo, please see the detailed

    discussion about Above-Below towards the end of this document.

    3. Initializing a Window to Enable StereoIn order to utilize OpenGL's stereo buffering support, a graphics window must be initialized

    using the Windows API call, SetPixelFormat(), with the pixel format descriptor flag,

    PFD_STEREO, set. Here is some sample code, called from a method of the graphics window's

    class:

    PIXELFORMATDESCRIPTOR pfd;

    memset (&pfd, 0, sizeof (PIXELFORMATDESCRIPTOR)); //clear all to 0

    pfd.nSize = sizeof (PIXELFORMATDESCRIPTOR);

    pfd.nVersion = 1;pfd.dwFlags = PFD_DRAW_TO_WINDOW | PFD_SUPPORT_GDI |

    PFD_DOUBLEBUFFER | PFD_SUPPORT_OPENGL | PFD_STEREO;

    int iPixelFormat = ChoosePixelFormat (hdc, &pfd);

    BOOL bSuccess = SetPixelFormat (hdc, iPixelFormat, &pfd);

    SetPixelFormat() should be called only after a meaningful device context is available for it; it

    is generally good to do this right after ShowWindow()has been called.

    Note that Microsoft Windows only allows SetPixelFormat()to be called once for any givenwindow. Subsequent SetPixelFormat()calls, for any given window, are ignored. Thus,

    the PFD_STEREOflag must be set within a window's very first SetPixelFormat()call.

    If the user's graphics configuration is not set up for stereo buffering, Windows will not allow

    the PFD_STEREOflag to be set. Thus, after trying to set the PFD_STEREOflag, you should

    always check to see if the attempted stereo enabling actually succeeded in changed the flag.

    Here's how:

    BOOL bStereoAvailable;

    // pCDC, iPixelFormat, pfd are declared in above code

    iPixelFormat = GetPixelFormat (pCDC->m_hAttribDC);

    DescribePixelFormat (pCDC->m_hAttribDC, iPixelFormat, sizeof

    (PIXELFORMATDESCRIPTOR), &pfd);

    if ((pfd.dwFlags & PFD_STEREO) == 0) // stereo mode not accepted

    bStereoAvailable = FALSE;

    else // yes we're now in stereo

    bStereoAvailable = TRUE;

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    4/43

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    5/43

    // pCDC already declared as pointer to current CDC

    // Clear both back buffers

    glDrawBuffer (GL_BACK);

    glClearColor(0.2f, 0.2f, 0.2f, 0.0f);

    glClear (GL_COLOR_BUFFER_BIT);

    // Draw left eye view

    glDrawBuffer (GL_BACK_LEFT);

    glColor3b (0, 0, 127); // blue

    glRectf (-0.8f, -0.8f, 0.2f, 0.2f);

    // Draw right eye view

    glDrawBuffer (GL_BACK_RIGHT);

    glColor3b (127, 0, 0); // red

    glRectf (-0.2f, -0.2f, 0.8f, 0.8f);

    // Put what was just drawn onto the display

    BOOL bSuccess = wglSwapLayerBuffers (pCDC->m_hDC, WGL_SWAP_MAIN_PLANE);

    As the above code example shows, you can still use glDrawBuffer(GL_BACK) to draw to

    both left and right back-buffers at once. Also note that you can use glDrawBuffer()to

    access the left and right front-buffers directly (GL_FRONT_LEFTand GL_FRONT_RIGHT).

    5. An Introduction to Stereoscopic Perspective ProjectionsYou now know everything you need to know to put different stuff into left-eye and right-eye

    buffers. Now comes the interesting part: Doing perspective projections that will result in a

    stereoscopic effect that is both geometrically correct and pleasing to look at.

    A good quality stereo image is composed of two stereo pair elements, each of which being a

    perspective projection whose "center of projection" (let's use the simpler term, "camera",

    instead) is offset laterally relative to the other camera position.

    Let's start with the mathematical representation of a simple non-stereo perspective

    projection. Assuming that the camera lies on the positive zaxis at (0, 0, d)(this document

    uses a "right handed" coordinate system), d being the distance from the camera to the

    xyplane, (x, y, z), projects onto thexyplane at:

    (Equation 1)

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    6/43

    Thus, for example, if the camera is placed at (0, 0, 9), the arbitrary point (8, 5, 3) will project

    to (6, 3.75). See Figure 1 for a visual representation of perspective projection.

    Figure 1: A Perspective Projection of Two Points

    Next, we'll introduce a camera offset to the projection. To do a left-camera perspective

    projection, we'll offset the camera to the left by half the overall camera separation, (c/2).

    Except that, to make the math easier, we'll offset the entire scene to the right instead ofoffsetting the camera to the left. So, the left-camera projection of (x, y, z)now calculates to:

    (Equation 2)

    And, for the right-camera projection, we'll offset the entire scene to the left; the right-camera

    projection of (x, y, z)now calculates to:

    (Equation 3)

    Let's go back to the example, with the original camera at (0, 0, 9)and the arbitrary point (8,

    -5, -3). If we use a camera separation of 1, the left camera projects to (6.375, -3.75), and the

    right camera projects to (5.625, -3.75).

    Notice how, in the above example, the arbitrary point ends up projecting 0.75 units to the

    right in the left-camera view relative to its projection in the right-camera view. If one

    projection is superimposed over the other in a stereo viewing system, this will result in the

    arbitrary point appearing in what is the optics folks call "negative parallax", meaning that it

    will appear to float in front of the display surface. Conversely, if a scene element appears in

    the left-camera view to the left of where it appears in the right-camera view, it will appear

    with "positive parallax", meaning that it will seem to reside somewhere behind the display

    surface. "Zero parallax" is what happens when the left-camera projection of a point perfectly

    matches its right-camera projection; a scene element projecting at zero parallax will appear

    to reside right at the display surface. See Figure 2 for an illustration of how one perceivesnegative and positive parallax effects.

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    7/43

    Figure 2: Perception of Parallax Effects

    Generally, a pleasing, well balanced stereo image will make use of both negative parallax and

    positive parallax, and at least some of the 3D scene will project at or close to zero parallax.

    Unfortunately, if one uses Equations 2 and 3 to calculate the stereo pair projections all

    possible 3D points will project to negative parallax. All negative parallax tends to beuncomfortable to view.

    We can fix that by simply shifting the projected values leftward for the left-camera projection,

    and rightward for the right-camera projection. If we shift the projected points by the same

    amount of the original camera offset, the resulting geometry will place the original projection

    plane precisely at zero parallax. Scene elements originally placed in front of the projection

    plane will project to negative parallax, and scene elements originally placed behind the

    projection plane will project to positive parallax. Here are the new equations for the left eye:

    (Equation 4)

    ...And for the right eye:

    (Equation 5)

    Returning to our example, (8, -5, -3)now projects to (5.875, -3.75) for the left camera, and

    (6.125, -3.75) for the right camera, shifting it into positive parallax, and making it appear

    behind the display surface. This makes sense, since the scene element's originalz-coordinate

    of -3places it behind the projection plane, whosez-coordinate is 0.

    The two projections that we have derived in Equations 4 and 5 above are called "parallel axis

    asymmetric frustum perspective projections". Note that, even after translating the scene in

    onex-axis direction, and then translating the projected scene in the oppositex-axis direction,the projection axes, the camera-target vectors of the two stereo pair cameras, remain

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    8/43

    parallel. Our final step, in which we shift the projected scene, makes the frustums of the

    parallel projections asymmetrical, meaning that each camera's final projection shows more of

    the scene to one side of its axis than the other.

    To summarize, the end result is a pair of perspective projections rendered from differently

    offset camera positions, with frustum asymmetry applied to comfortably balance the overall

    stereo parallax effect.

    It is a common error for programmers to do stereo projections using a "toe-in" camera model.

    With this model, the cameras are still offset to one side or the other, but the camera-target

    vectors are not parallel, and converge on a single point. Some developers use this method

    because it is conceptually simpler and, sometimes, easier to implement than parallel axis

    asymmetric frustum projections. Also, with this method, a balance between positive parallax

    and negative parallax is achieved without the need to shift the projections as we do within

    Equations 4 and 5. Unfortunately, the camera toe-in approach is geometrically incorrect, andleads to some variable vertical misalignment between stereo pair elements, which can make

    for uncomfortable viewing. We do not recommend the "toe-in" camera model.

    6. Implementing Asymmetric Frustum ProjectionsNow that I've explained the proper way to do stereo projections mathematically, let's talk

    about how to do these projections in your application. If your application already does a

    perspective projection, the elements that you need to add, for each of two otherwise identical

    stereo pair perspective projections are:

    Center of projection (camera) offset, and

    Post-projection shift, or frustum asymmetry

    The camera offset is easily accomplished using OpenGL's glTranslate()functions (this

    document will use the double-precision version of the function, glTranslated()). In order

    to effect the pre-projection camera offset, we actually need to call glTranslated()just

    afterthe code that does the perspective projection. As in the mathematical discussion above

    in "5. An Introduction to Stereoscopic Perspective Projections", we will effectively

    translate the camera by instead translating the entire scene in the opposite direction. Here's

    the code (where StereoCameraOffset equals half the overall camera separation, negative

    for the left camera and positive for the right camera): glTranslated

    (-StereoCameraOffset, 0, 0);

    There are a few different ways to make each stereo projection's frustum asymmetrical. One

    imperfect approach would be to simply apply an offset (towards the left for the left-camera

    rendering, towards the right for the right-camera rendering) when viewporting the regular

    (symmetric frustum) perspective projections. Though this approach is sometimes easy to

    implement, and the resulting stereo images are geometrically correct, the disadvantage is

    http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#5#5http://www.stereographics.com/support/developers/pcsdk.htm#5#5
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    9/43

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    10/43

    In the above discussion about implementing asymmetric frustum projections, two important

    questions were left unanswered:

    How much camera-offset should one use, to get a stereo effect that is strong enough to

    offer an effective sense of depth, yet not so strong that viewing is uncomfortable?

    How much frustum asymmetry should be applied, in order to yield a pleasing balance

    between positive and negative parallax?

    Both questions get into the realm of a lot of evolving research, and a certain amount of

    controversy. For example, StereoGraphics' own documentation used to advise "don't exceed

    parallax values of more than 1.5". We know now that a person's relative acceptance and

    tolerance of different parallax magnitudes, on a computer screen or a projection display, is

    far more consistent when parallax is expressed as a percentage of viewport width, than when

    parallax is computed as an angular measure based on retinal disparity. Which is actually quite

    convenient for the software developer, since it eliminates the need to guess at variables like

    the user's display size and seating position.

    Thus, we now advise setting up perspective projections such that the negative parallax and

    positive parallax effects (take off the stereo glasses to measure on-screen parallax) each fall

    within about 3% or so of the image's overall viewport width. Since the viewport width

    represents a projection plane in the 3D scene, a good starting point for offsetting each stereo

    camera is about 3%of the 3D scene's horizontal range. The 3D scene's horizontal range

    should be measured along the plane where the camera's projection frustum intersects the

    center of interest in the scene (which is roughly where we will probably want the plane of zero

    parallax to be).

    So, let's say that we are rendering a mechanical part whose bounding box has a width of 100

    units, and that mechanical part nearly fills the screen. You would probably want to offset each

    camera laterally by about 3 units. Here's the updated camera translation source code:

    double StereoCameraOffset = Xrange * 0.035 * UserOffsetAdjustment;

    if (WhichEyeProjection == LEFT_EYE_PROJECTION)

    StereoCameraOffset = -StereoCameraOffset;

    glTranslated (-StereoCameraOffset, 0, 0);

    ...Where Xrangeequals the horizontal range of the scene along the desired plane of zero

    parallax. One way to derive Xrangeis to get the difference between glFrustum()'s first

    two arguments, which represent the projection frustum's horizontal range at the near

    clipping plane, and multiply that difference by the ratio of the distance to the desired plane of

    zero parallax to the near clipping plane distance. Another way to calculate Xrangewould be

    to multiply the distance to the desired plane of zero parallax by two times the tangent of half

    the horizontal field of view angle.

    Also note that a "UserOffsetAdjustment " factor was thrown into the equation. It is a goodidea to allow users to adjust the strength of the stereo effect to suit their preference.

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    11/43

    UserOffsetAdjustment 's default value should be 1.0, and the user should be able to

    adjust its value downward towards 0.0(which would result in no stereo effect at all), or

    upward (2.0is usually OK as an upper limit). If your user interface provides some kind of

    keypad stereo adjustment, UserOffsetAdjustment should ideally be adjusted based on

    multiplication (i.e.: UserOffsetAdjustment *= 1.1) rather than addition and subtraction.

    Next, we need to quantify the amount of each stereo projection's frustum asymmetry. Recall

    that in "6. Implementing Asymmetric Frustum Projections", we added a factor called

    "FrustumAsymmetry" (positive for the left-camera projection, negative for the

    right-camera projection) to each of glFrustum()'s first two arguments: glFrustum

    (FrustumLeft + FrustumAsymmetry, FrustumRight + FrustumAsymmetry,

    FrustumBottom, FrustumTop, NearClipDistance, FarClipDistance);

    Further recall, from Equations 4 and 5, that the amount of frustum adjustment, when

    measured in the projection plane, should equal the amount of the original camera offset(though, in the opposite direction), in order for the frustum adjustment to place the

    projection plane at zero parallax. Thus, FrustumAsymmetry should equal

    -StereoCameraOffset.

    However, glFrustum()'s interprets its first two parameters as xaxis boundaries, as

    measured on the near clipping plane. Yet, FrustumAsymmetry is being calculated based on

    the desired amount of frustum asymmetry in what is to become the plane of zero parallax. So,

    FrustumAsymmetryneeds to be adjusted by the ratio of the near clipping distance to the

    desired zero-parallax distance. Here's the resulting source code: double

    FrustumAsymmetry = -StereoCameraOffset * UserBalanceAdjustment;

    double n_over_d = NearClipDistance / ZeroParallaxDistance;

    FrustumAsymmetry *= n_over_d;

    glFrustum (FrustumLeft + FrustumAsymmetry, FrustumRight

    + FrustumAsymmetry, FrustumBottom, FrustumTop,

    NearClipDistance, FarClipDistance);

    Notice that we have introduced yet another user adjustment factor,

    "UserBalanceAdjustment". As with the stereo camera offset, it's a good idea to let the

    user adjust the parallax balance to their liking. UserBalanceAdjustment 's default value

    should also be 1.0, and the user should be able to adjust its value downward towards 0.0

    (which would result in no frustum asymmetry, hence all negative parallax), or upward (2.0 is

    once again a good upper limit). And, like the camera offset adjustment factor,

    UserBalanceAdjustment should be adjusted multiplicatively (or, perhaps, via a dialog box)

    rather than by addition or subtraction.

    Also note that the above code is set up such that UserOffsetAdjustment affects both the

    amount of camera offset and the amount of frustum asymmetry. This is appropriate because,

    if the amount of frustum asymmetry is not adjusted proportionally whenever the camera

    offset is changed, camera offset changes will have the side-effect of changing the scene'sparallax balance.

    http://www.stereographics.com/support/developers/pcsdk.htm#6#6http://www.stereographics.com/support/developers/pcsdk.htm#6#6http://www.stereographics.com/support/developers/pcsdk.htm#6#6http://www.stereographics.com/support/developers/pcsdk.htm#6#6
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    12/43

    Other stereo camera adjustment issues:

    The horizontal frustum range (Xrange) is directly proportional to the tangent of half the

    horizontal field of view angle. So, if the field of view angle is changed, the stereo camera

    offset and frustum asymmetry both need to be recalculated.

    The horizontal frustum range (Xrange) is also directly proportional to the distance from

    the camera to the desired plane of zero parallax. So, if you "dolly" the camera to get

    closer to an object, and want the plane of zero parallax to remain the same relative to that

    object's position, both the stereo camera offset and the frustum asymmetry factors will

    need to be recalculated. In fact, stereo camera offset and frustum asymmetry factors

    should be recalculated any time the distance from the camera to the desired plane of zero

    parallax changes.

    Depending on the application's rendering architecture, the projection frustum may be

    calculated using different units from those used in the 3D scene. In such unusual cases, it

    may be best to keep the frustum asymmetry factor constant and independent of the

    camera-offset amount (though both UserOffsetAdjustment and

    UserBalanceAdjustment should still affect the frustum asymmetry).

    8. Other Stereo Aesthetic IssuesThe last few sections have discussed stereoscopic perspective projections. Some have

    wondered if it is possible to do stereoscopy with orthographic projections. Though it istechnically possible to do stereo orthographic projections using the camera toe-in approach,

    the results are so uncomfortable that we strongly advise against it. Thus, developers should

    design their applications such that available stereo display options will always be used in

    combination with perspective projection.

    Similarly, for the best quality stereo, the stereo pair perspective projections should use a

    moderately wide field of view angle (note that a narrow "telephoto" field of view angle results

    in a projection geometry that is quite similar to that of an orthographic projection). For the

    best results, we recommend a horizontal field of view angle of 50 or more.

    One significant issue relating to negative parallax is a phenomenon that occurs when a scene

    element at negative parallax is clipped by an edge of the rendering window.The problem is

    that a scene element that appears to be floating somewhere in front of the display surface is

    occluded by an edge that is at the display surface. This results in a somewhat disturbing

    optical contradiction in which the occluding edge is farther away than the scene element that

    it occludes.

    Some people firmly believe that this negative parallax edge-clipping effect must be avoided

    at all costs, even if that means not ever using any negative parallax at all (to do this, they

    place the zero parallax setting at the near clipping plane). We have found that approach to be

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    13/43

    too extreme. Eliminating negative parallax tends to result in either uncomfortable amounts of

    positive parallax, a flattening of the stereo effect within a narrow portion of the positive

    parallax range, or both. Using some balance of positive parallax and negative parallax results

    in stereo images that are more comfortable to view, even if that approach inevitably results

    in some amount of negative parallax edge-clipping.

    How you should deal with the negative parallax edge-clipping issue depends on the nature of

    your application. In a mechanical CAD application where the scene elements of interest will

    usually not be clipped by the window edge, it is usually safe to place the zero-parallax plane

    at or just in front of the object's center. However, with a "flythrough" type of application, it is

    often best to set the zero-parallax distance such that most (though not all) of the scene

    projects to positive parallax.

    Finally, it should be mentioned that very high contrast values in a stereo image will often

    result in "ghosting", in which some of one eye's view appears as a "ghost" in the other eye'sview. This tends to be caused by CRT phosphor persistence (ghosting can also be an issue

    when using projection displays). Green tends to be the worst offender. The workaround to

    this problem is to avoid extreme amounts of contrast if at all possible. Use a gray background

    instead of a black background (even dark gray is better than black), and if possible, try to

    avoid using bright white, green, and cyan scene elements against a dark background.

    9. Above Below Stereo FormattingIn addition to supporting the OpenGL stereo buffering standard, StereoGraphics also makes

    a stereo viewing system that permits full-screen stereo viewing with almost any PC graphics

    card. Stereo software designed for this type of stereo system needs to use Above-Below

    stereo formatting. (Note that this section is not relevant to you if you are developing software

    using OpenGL stereo buffering.For more information about the differences between these

    two stereo hardware systems, please see "2. Setting Up Your Graphics Hardware To

    Support Stereo".)

    The Above-Below system's stereo emitter includes circuitry which, when in stereo display

    mode, doubles the frequency of the vertical sync signal. This causes the display to refresh at

    twice its normal rate, which has the effect of vertically stretching the screen display. At this

    doubled display frequency, whatever was previously on the top half of the display, and

    whatever was previously on the bottom half of the display, each take up the full display on

    alternate refreshes.

    Thus, to put up a stereo image which will appear stereoscopically using this hardware system,

    you need to viewport the left camera's rendering to the top half of the overall display, and

    viewport the right camera's rendering to the bottom half of the overall display. Since the

    sync-doubling circuitry stretches everything vertically, each rendering should have a 1:2

    pixel aspect ratio such that everything originally appears vertically squashed.

    http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#2#2http://www.stereographics.com/support/developers/pcsdk.htm#2#2
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    14/43

    There is one more important detail to Above-Below stereo formatting: Normally, every

    vertical scan of the display includes hundreds of visible horizontal scan lines, followed by 20

    to 50invisible ones (the "blank interval"). When sync-doubling, we need to insert a second

    blank interval (draw it as a black field) across the middle of the original display. The two

    stereo pair viewports end up with the remainder of the display, each getting a little less than

    half of the original vertical display resolution.

    For example, if the original display resolution is 1024x768, and the blank interval thickness is

    40, each stereo pair viewport ends up with half of the remainder of the vertical resolution,

    (768-40)/2, or 364. Thus, each stereo pair viewport will have a pixel size of 1024x364, and

    the two stereo pair viewports will be separated by a black blank interval region whose pixel

    size is 1024x40. The left-camera projection would be mapped to the top viewport (pixel-rows

    0 through 363), the right-camera projection would be mapped to the bottom viewport

    (pixel-rows 404 through 767), and the new blank interval would appear exactly mid-display

    (pixel-rows 364 through 403).

    In order for the two stereo pair viewports to be positioned with proper vertical alignment, the

    newly created blank interval must have a vertical thickness that perfectly matches the

    original blank interval. Since blank interval thickness varies, depending on the user's graphics

    card, display resolution, and other display settings, Above-Below stereo software must be

    designed to accommodate different blank interval thicknesses. This usually means providing

    the user with some kind of calibration screen, in which the user lines up two arrows while in

    stereo mode.

    Remember: Sync-doubling affects the entire display, including window borders, menu bars,

    the Windows Taskbar, other application windows, etc. For this reason, an Above-Below

    application window needs to fill the entire display, blocking out all other application windows

    including the Windows Taskbar. Additionally, an Above-Below application window should

    neither have a border, nor standard title bars, menu bars, or status bars. Interface design

    using Above-Below stereo formatting can be a challenge.

    Other Above-Below programming notes:

    With the StereoGraphics sync-doubling hardware that supports Above-Below stereo

    formatting, the user toggles stereo display mode on and off manually using a physical

    switch. Thus, stereo display mode switching is not controlled by software.

    Sections 5 through 8, relating to stereoscopic projections, apply to Above-Below stereo

    formatting, as well as OpenGL stereo buffering.

    10. Points to Remember With OpenGL stereo buffering, the necessary elements are:

    - Check for stereo display configuration availability, and enable stereo buffering supportwhen initializing each graphics window.

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    15/43

    - Render two asymmetric frustum perspective projections, one to each of the two stereo

    back-buffers. Then swap buffers to put the stereo pair on the display.

    - Offset each stereo camera using a lateral translation (glTranslate()). Stereo

    projection axes should remain parallel to the original projection axis.

    - Balance the stereo parallax by making the perspective projection frustums asymmetrical.

    This can be done by changing the first two arguments of glFrustum(), or by altering

    the transformation matrix that does the projection.

    Use enough stereo camera separation to yield a pleasing stereo effect, but not so much as

    to be uncomfortable. In general, on-screen parallax should be limited to about 3%or so of

    viewport width, for both negative and positive parallax effects. For the best stereo effect,

    use a wide-angle perspective projection, with a field of view angle of 50or more.

    Parallax effects should be balanced such that there is some negative parallax, and some

    positive parallax. To do this, apply the right amount of projection frustum asymmetry to

    put the plane of zero parallax near the center of interest in any given scene. (For some

    applications such as "flythrough" applications, it may be desirable to use more positive

    parallax than negative parallax, in order to reduce the amount of negative parallax that is

    clipped by the window edges.)

    Stereo projection settings should not be fixed quantities. Recalculate the camera

    separation and frustum asymmetry any time that the field of view angle or the

    camera-to-target distance changes. Stereo projection setting calculations should also

    include user-adjustable factors.

    Above-Below formatting is another approach to doing stereo display on a PC. OpenGL

    stereo buffering and Above-Below formatting use different StereoGraphics stereo display

    hardware.

    11. ResourcesAs previously mentioned, many of the concepts discussed in this document are illustrated in the

    example program, "OGLPlane", which is available from StereoGraphics. Another simpler

    example program, "RedBlue", illustrates stereo OpenGL buffering without doing any stereoprojections (it simply draws colored rectangles to each stereo buffer). Other example programs

    may additionally be available at our website, http://www.stereographics.com , and in the

    "Developers" directory of our ftp site, ftp.stereographics.com.StereoGraphics developer support

    can also be reached at [email protected], or 415-459-4500.

    Stereoscopic display principle:

    The set stereoscopic display ModelView matrix, the projection matrix for P conversion of any one

    ftp://ftp.sterographics.com/ftp://ftp.sterographics.com/ftp://ftp.sterographics.com/
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    16/43

    point of the object space to screen coordinates:

    ModelView vM , pM ,P

    PMMP vp*

    PMMMMP vtsp*

    ModelView vt

    MM

    Projection spMM

    L R

    Fd

    Sd

    L R

    Fd*R Fusion

    Distsance

    Eye Seperation Distance: Sd*R

    The ratio of Virtual World to Real world:

    R = FusionDistance / RealScreenToEyeDistance

    FusionDistance = Fd * R;

    setFusionDistance

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    17/43

    View Matrix Transformation

    L R

    Fd

    Sd

    (x,y,z)

    X = x +sd/2 * R

    1000

    0100

    0010

    2/*001 RS

    M

    d

    t

    Perspective Matrix Transformation

    [-1,1]x[-1,1]x[-1,1]

    1) glFrustum

    2 perspective

    a)

    (XX) / (0.5*Sd*R) = -Z/(Fd *R)

    X = X +Z/Fd *0.5*Sd

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    18/43

    L R

    Fd

    Sd

    PP

    P X

    2/dS P P d

    RF

    z

    RS

    d

    dd *2/*

    Z

    d

    d

    F

    Szd

    *2

    *

    d

    d

    F

    Szxdxx

    *2

    *'

    1000

    0100

    0010

    0*2

    01d

    d

    s

    F

    S

    M

    2

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    19/43

    L R

    Fd

    Sd

    PP

    -11

    Sd*R/2-1 1

    Fd*R*aspect * tan(fovy/2)

    )*)2/tan(**2/( aspectfovyFS dd

    )2

    (fovy

    ctgf

    1000

    0100

    0010

    ***2

    001 faF

    Sd

    1000

    0100

    0010

    ***2

    001 faF

    Sd

    * pM

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    20/43

    L R

    Fd

    Sd

    PP

    -11

    02

    00

    100

    000

    000

    1''''

    zfarznear

    zfarznearzfarznear

    zfarznear

    fa

    f

    zyxwzyx

    P(x,y,z,1) x1

    X1/x = fd/(-z) x1 = x*fd/(-z)

    X= (X1-sd/2)/(fd*tan(fovy/2)*a) = ( x *(1/(a*tan(fovy/2)) + z ( sd/(2fd*a*tan(fovy/2))) /(-z)

    )

    22

    2

    ()(

    1

    2

    2

    2

    2"1

    fovytgaf

    zs

    fovyatg

    x

    zfovytgaf

    s

    z

    xf

    fovytgaf

    sx

    x

    d

    d

    d

    dd

    d

    d

    P= (x, y, z, w)

    2

    'fovy

    atg

    xx zw '

    100

    22

    0100

    0010

    0001

    '''''"""""

    fovytgaf

    szzyxzzyxwzyx

    d

    d

    x,y,z,w, x d

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    21/43

    100

    0100

    0010

    0001

    ''''

    d

    wzyxwzyx

    x= x+dw; x/w= x/w + d; x -sd/2 -sd/(2a*fd*tgfovy/2) fd sd fd sd

    (Vx, Vy, Vz), Rx,Ry,Rz alpha, beta. Fd, Sd

    vx,vy,vz

    rx,ry,rz

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    22/43

    0 11 2*f*tg(alfa/2.0) (f*tg(alfa/2)+s/2 w/2) / ( 2*f*tg(alfa/2)) (f*tg(alfa/2)+s/2 + w/2)/ ( 2*f *tg(alfa/2)) 3dmax 2 * Atg( (s/2 + w/2)/f )

    s=0.06, w=1.6, f=3.0 15.46*2 = 30.93

    3dmax

    s

    f

    w

    s

    f

    w

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    23/43

    (f*tg(alfa/2)+s/2 w/2) / ( 2*f*tg(alfa/2)) (f*tg(alfa/2)+s/2 +w/2)/ ( 2*f *tg(alfa/2))

    alfa

    (f*tg(fovy/2) h/2)/(2*tg(fovy/2)*f), (f*tg(fovy/2) + h/2)/(2*tg(fovy/2)*f)

    alfa, fovy f, s, w, h f, s, w, h f

    Sd, (offsetx, offsety,offsetz), glFrustumn znear =sd+offsetz, x,y -w/2, -h/2,(w/2, h/2)offsetx, offsety, offsetz

    f

    h

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    24/43

    -w/2-offsetx, -h/2-offsety,w/2-offsetx, h/2-offsety, znear zfar znear znear z=-znear -w/2-offsetx, -h/2-offsety, -sd-offsetzw/2-offsetx, h/2-offsety, -sd-offsetz z= -znear(-w/2-offsetx) / left = (-sd-offsetz) / -znear

    => (-w/2-offsetx)/left = (sd+offsetz)/znear

    => left = znear * ( -w/2-offsetx)/(sd+offsetz)

    -h/2-offsety/bottom = (sd+offsetz)/znear Bottom = znear*(-h/2-offsety)/(sd+offsetz)

    (w/2-offsetx)/right = (sd+offsetz)/znear

    Right = znear*(w/2-offsetx)/(sd+offsetz)

    (h/2-offsety)/top = (sd+offsetz)/znear

    Top = znear *(h/2-offsety)/(sd+offsetz)

    offsetx

    4

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    25/43

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    26/43

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    27/43

    4

    4

    3D 3D

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    28/43

    4

    4

    4

    4

    DVD

    090 45 135

    0 90

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    29/43

    135246

    4

    4

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    30/43

    4

    4

    CRT

    CRT

    85

    85 42.5

    170

    120 60

    170CRT

    CRT

    4

    4

    4

    DVD

    NVIDIA 3D NVIDIA

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    31/43

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    32/43

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    33/43

    OpenGL/Direct3D

    a)

    b)

    c) Quadro Buffer

    d)

    stereo stereo images.

    STEREO PHOTO SLIDE BARS

    A Slide Bar enables you to take a pair of photos for stereo viewing, of still life scenes, with

    a single camera. If you are new to 3D-Photography, I recommend the well written and

    easy to understand book "Photographing in 3D" by David Burder FRPS & Pat Whitehouse

    FRPS. It explains all the basic 3D photo procedures and is beautifully illustrated with lots

    of colorful 3D photos. It is listed in the "Reel 3-D"catalog.

    The Slide Bar is attached mounted on a tripod. The Roller Block is attached to your camera, then slipped

    onto the Bar. A pair of photos is taken, one on the left of center, one on the right. After processing, the

    http://www.stereoscopy.com/reel3dhttp://www.stereoscopy.com/reel3dhttp://www.stereoscopy.com/reel3dhttp://www.stereoscopy.com/reel3d
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    34/43

    slides are viewed using any of the hand-held viewers or projector set-ups that will take regular 2"x2"

    slides or hand mounted full-frame slides.

    We offer Slide bars in two convenient lengths:8" (20.32 cm)and16" (40.64 cm).A specialSingle Vertical

    Mountis available to mount cameras vertically instead of horizontally.

    Slide Bars for Medium Format, Large SLR's and Heavy Duty Work are Now available in the

    following lengths: 18" - 28" with Twin Roller Blocks, Bubble Levels and End Safety Stops.

    8" Slide Bar

    The 8" (20.32 cm) Slide Bar is compact and fits easily into your camera bag. The roller block and bar are

    designed with color coded indent positioning, at center and three positions each side of center:

    Color Shift Format

    Approx.

    Subject Distance

    Yellow " (6.35 mm) L & R Macro 1 Foot (30 cm)

    Green " (19.05 mm) L & R Close-Up 4 Feet (120 cm)

    Red 1" (31.75 mm) L & R Scenes-Normal 6 Ft. (180 cm) - Infinity

    The shift distances are based on a "Rule of Thumb" of 30:1. Total left-right travel on the bar is 4" (114.3

    mm). The block is removable and has a thumb screw lock for easy action.

    Features

    Solid High Grade 6061 Aluminum Construction

    Bubble Level

    End Safety Stops

    Black Anodized Finish

    "-20 TPI Mounting Screws

    Click Stop Positioning Color Coded Scale

    http://www.stereoscopy.com/jasper/slide-bars.html#8inch#8inchhttp://www.stereoscopy.com/jasper/slide-bars.html#8inch#8inchhttp://www.stereoscopy.com/jasper/slide-bars.html#8inch#8inchhttp://www.stereoscopy.com/jasper/slide-bars.html#16inch#16inchhttp://www.stereoscopy.com/jasper/slide-bars.html#16inch#16inchhttp://www.stereoscopy.com/jasper/slide-bars.html#16inch#16inchhttp://www.stereoscopy.com/jasper/slide-bars.html#vertical#verticalhttp://www.stereoscopy.com/jasper/slide-bars.html#vertical#verticalhttp://www.stereoscopy.com/jasper/slide-bars.html#vertical#verticalhttp://www.stereoscopy.com/jasper/slide-bars.html#vertical#verticalhttp://www.stereoscopy.com/jasper/slide-bars.html#vertical#verticalhttp://www.stereoscopy.com/jasper/slide-bars.html#vertical#verticalhttp://www.stereoscopy.com/jasper/slide-bars.html#vertical#verticalhttp://www.stereoscopy.com/jasper/slide-bars.html#16inch#16inchhttp://www.stereoscopy.com/jasper/slide-bars.html#8inch#8inch
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    35/43

    Roller Block Design

    Block Lock

    Instructions Included

    Made in the USA

    Left-Right Travel 4.25" (108 mm) Total Dimensions: .75" x 2" x 8" (1.9 cm x 5.1 cm x 20.3 cm)

    $84.00(plus S&H)

    12" Slide Bar

    This Slide Bar has one Roller Block and a 300 mm Scale (ruler) inset into it for easy and very precise

    shifting in small or large increments. A Bubble Level is also inset into the Bar. The Roller Block has a

    Thumb Screw Lock for smooth action. Safety Button Stops are at each end of the Bar.

    Features

    Solid High Grade 6061 Aluminum Construction

    Black Anodized Finish 300 mm Scale (Ruler)

    Bubble Level

    "-20 TPI Mounting Screws

    Dimensions: .25" Thick x 1.50" Wide x 12" Long (0.64 cm x 3.8 cm x 30.5 cm)

    Total Left-Right Travel 4.12" (10.5 cm) each side of center

    End Button Stops - Safety Stops

    Made in the USA

    $94.00(plus S&H)

    16" Slide Bar

    The 16" (40.64 cm) Slide Bar has been discontinuedand was replaced by the18" Heavy Duty Twin

    http://www.stereoscopy.com/jasper/heavyduty-bar.htmlhttp://www.stereoscopy.com/jasper/heavyduty-bar.htmlhttp://www.stereoscopy.com/jasper/heavyduty-bar.htmlhttp://www.stereoscopy.com/jasper/heavyduty-bar.html
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    36/43

    Camera Slide Bar.

    Single Vertical Mount

    If you want to take vertical format instead of the regular landscape format

    stereo photos, use this handy Single Vertical Mount to attach one or two

    cameras to the Slide Bars above.

    $35.00 (plus S&H)

    How to View & Viewing Practice for Autostereograms(C) 1999 by Gene Levine, all rights reserved

    This page is intended to guide visitors that have never seen

    stereogramic effects, and those viewers who may be a bit

    rusty, You may want to first read theAbout Autostereograms

    page to get an idea of what you are about here.

    Some people see the effect right away, others can spend a few

    days. I've observed that the greater majority may need fifteen

    to thirty minutes. Please don't be discouraged if you can't

    visualize the effects right away. After all--what you are doing

    is overcoming a lifetime habit of viewing everything with

    "normal" stereo-vision: that which gives us a sense of depth in

    in our everyday viewing of the world.(Fig. 1)

    http://www.colorstereo.com/texts_.txt/aboutstr.htmhttp://www.colorstereo.com/texts_.txt/aboutstr.htmhttp://www.colorstereo.com/texts_.txt/aboutstr.htmhttp://www.colorstereo.com/texts_.txt/practice.htm#anchor1189786#anchor1189786http://www.colorstereo.com/texts_.txt/practice.htm#anchor1189786#anchor1189786http://www.colorstereo.com/texts_.txt/practice.htm#anchor1189786#anchor1189786http://www.colorstereo.com/texts_.txt/practice.htm#anchor1189786#anchor1189786http://www.colorstereo.com/texts_.txt/aboutstr.htm
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    37/43

    If you ordinarily wear glasses to read off your monitor's screen,

    you will likely need them here. I have found that single lens

    glasses (as opposed to bi/tri focal, or progressive lenses) are

    the best, by far.

    First: let's try a visual aid. After that are practices for

    viewing without aid.

    By placing a cardboard between your eyes(Fig, 2)you cannot

    use normal or cross-eyed vision. Instead, you are forced into

    parallel vision which is just what we need for the majority of

    stereograms.

    A cardboard about 8 x 11 inches.

    I have illustrated a cut-out for nose

    and glasses, but none is necessary.

    Unlike cross-eyed vision, there is no strain or discomfort with

    parallel vision. The essential key, in fact, is to relaxyour eyes

    into viewing this way.

    http://www.colorstereo.com/texts_.txt/practice.htm#anchor1189786#anchor1189786http://www.colorstereo.com/texts_.txt/practice.htm#anchor1189786#anchor1189786http://www.colorstereo.com/texts_.txt/practice.htm#anchor1189786#anchor1189786http://www.colorstereo.com/texts_.txt/practice.htm#anchor1189786#anchor1189786
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    38/43

    Top View

    Return

    Below is a stereo-pair image. Place cardboard directly in

    middle of pair, as illustrated in Fig. 2. Now place other end of

    cardboard between your eyes. Disregard focusing, for now.

    If alignments are good, you should see only one image. Now

    relax your eyes, and slowly bring things into focus pulling your

    head back. You do not think you see a 3-D effect--you know

    for sure. When you are sure, hold that focus and remove

    cardboard. You should now see three images: the one in the

    middle containing the 3-D effects. Congratulations, you are

    now viewing an autostereogram as it should be seen.

    http://www.colorstereo.com/texts_.txt/practice.htm#anchor1209618#anchor1209618http://www.colorstereo.com/texts_.txt/practice.htm#anchor1209618#anchor1209618http://www.colorstereo.com/texts_.txt/practice.htm#anchor1209618#anchor1209618
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    39/43

    A Stereo-Pair

    If you want to immediately practice with this aid, I suggest the

    Stereo-Pairs Galleryat Color Stereo I. Always place the

    cardboard directly in the middle, and when you see the 3-D

    effect, pull cardboard away.

    Return to Top of Page

    Below are practices without aids. The only thing you'll need

    here is a monitor and two eyes.

    Let go the normal way you focus on something on a

    page. Let the eyes relax.

    Practice # 1

    o. . . . . . . . . . . o

    Is that it? Two zeros?

    http://www.colorstereo.com/_CS_1/pairs.img/_pairs_m.htm#anchor851277http://www.colorstereo.com/_CS_1/pairs.img/_pairs_m.htm#anchor851277http://www.colorstereo.com/texts_.txt/practice.htm#anchor2613491#anchor2613491http://www.colorstereo.com/texts_.txt/practice.htm#anchor2613491#anchor2613491http://www.colorstereo.com/texts_.txt/practice.htm#anchor2613491#anchor2613491http://www.colorstereo.com/_CS_1/pairs.img/_pairs_m.htm#anchor851277
  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    40/43

    What you want to do here is have your mind process these two

    objects until they appear as three. Let the eyes relax, and

    move your head forward or away until three zeros appear

    clearly.

    Your primary inclination is to focus on the above two objects

    as is normal. But now, look behind them; look into the inside

    depths of your monitor and forget about focusing. Try this for

    awhile, until you gradually see the three zeros... or you get a

    headache.

    You can also practice this with two dots, a couple inches apart,

    on a piece of paper. Try staring through the paper at a space

    a few feet behind it.

    When you see a non-existent object appear between the two

    existing ones, you have mastered the basis of the Stereo Pair.

    It is the center object where the 3D effect takes place. This is

    the crux of autostereograms.

    So where does that center image come from?

    It's helpful to remember that visual perception happens in the

    brain--not the eyes. What we're doing here, is fooling the

    brain. The eyes are feeding it visual information as usual, but

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    41/43

    notin the usual manner. The mind gives us a middle object.

    And if you introduce some subtle offsets into two otherwise

    similar objects, the mind will perceive the famous 3D effect

    we're here for.

    Practice # 2

    0. . . . . .. . . . . . . 0 . . . . . .. . . . . . . 0

    If you view three objects as an autostereogram, you should

    perceive four objects. Four objects will look as if there are five,

    etc, etc.

    Practice # 3

    And now for some 3D.

    Between these two objects, another object should appear with

    the smaller square floating over the larger.

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    42/43

    Practice # 4 Still cant see it?

    Pull back, and focus normally on the center object of the three,

    below. Now lean slowlyforward into the screen holding that

    focus until it is broken or you see four objects, clearly.

    I hope this page has helped. Master these practices, and you

    should have no problem moving on to full fledged

    autostereograms

    Viewing Considerations & Compromises

    A comfortable reading distance is a good starting point for viewing stereograms on-screen, or on a

    page. However, drawing back from the monitor may not only help in viewing larger images, but

    increase the 3-D effect. Also, I find the longer I stare at a stereogram, the greater the stereogramic

    effect.

    Bringing an autostereogram into focus is a gradual sensation, but switching from "autostereovision"

    to normal vision is abrupt, and can be uncomfortable. I find the best way to avoid any such

    discomfort is to breakaway from the autostereogram by briefly closing your eyes, and then opening

    them using normal vision.

    All my stereograms are made to be viewed wide-eyed, as are most hidden-image stereograms in

    general.

    How can you tell if your using wide-eyed or cross-eyed vision?

    Many times I realize someone is viewing cross-eyed where it's meant for wide-eyed vision to be

    used, and they're missing the correct 3-D effect, or unable to see stereogramic altogether.

    Unfortunately, there's no easy way to tell, or coach the casual viewer, but keep in mind that

    autostereograms using parallel vision may actually feel soothing to the eyes. Whereas, images

    requiring cross-eyed vision can produce enough cumulative eye-strain to produce a headache if

  • 8/13/2019 Writing Stereoscopic Software - Bob Akka

    43/43

    your eye muscles are not use to it. In my experience, staring at enough images on a regular basis

    develops the eye muscles (like exercising any other muscles) to a point where you can view with

    total comfort... unless, of course you create stereograms for hours on end, in which case, nothing

    can save you.

    Why you might see a double image:Especially when viewing hidden-image stereograms, you

    may sometimes see a leaner image layered above a wider image. This is from diverging your vision

    too broadly. Stereograms are all made of vertical columns. If vision diverges too much, your brain

    will factor in two columns at once, instead of single side-by-side. This happens more often with

    experienced viewers.

    Why you might see some, and not see other stereogram effects:

    There are a couple reasons you might see stereo effects in some stereograms, but try without

    success with others.

    1) you may be using the wrong vision: cross-eyed instead of wide-eyed2) your monitor size and screen resolution may be too small, or too large.

    Or, it could be a combination of the two. Sometimes, in the frustration from being unable to view

    stereogramic effects due to inadequate monitor/resolution sizes, a viewer might try too hard and

    end up using cross-eyed vision where only wide-eyed will work.

    IMAGE QUALITY

    The images on this site were all created at far larger sizes. As a consequence, there is detail, and

    quality that is necessarialy sacraficed to display an image on a Web site.

    The final web image is again compromised by the compression-quality ratio inherent in the JPG

    image format. I have mostly used 7 on a scale of 12, which means image quality has been

    moderately sacrificed, but quite adequate.

    Presentationof a stereogram is best served by as little distraction on the page as possible.

    Especiallyany kind of stray patterns or words on either side can create visual dissonance.

    Coloraccuracy is always desirable, but makes no difference whatsoever with the 3D effect. Allimages should show a 3-D effect if reduced to grayscale--or even just black & white.

    It's a lot of compromising, but my justification is to raise autostereograms to a high art form, and

    bring pleasure to those people who find their way to Color Stereo.