Version: 1.0

Posted: 2003-02-20

Build Requirements: N/A

Runtime Requirements: Mac OS X see stereo presentation (recommended but not required).

View Source Code:

Download Sample (“GLUTStereo.zip”, 19.3K)
Download Sample (“GLUTStereo.dmg”, 78.9K)



Description

1.1 (2/20/03): Adds the ability to switch in and out of stereo mode and better support. An examples showing how to set up and use stereo with GLUT under Mac OS X v10.2.3 or later. GLUT stereo support requires setting a stereo pixel format then using glutGameMode to get a full screen stereo drawable. Stereo in a window is not supported at this time. Below is an example of this set up: glutInit(&argc, (char **)argv); // stereo display mode for glut glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH | GLUT_STEREO); glutGameModeString("1024x768:32@120"); // must now use full screen game mode // enter gamemode to get stereo context // (may get invalid drawable warnings in console, // this is normal and will be fixed in the future) glutEnterGameMode(); Once the stereo context is set up the application simply renders into the left and right back buffer and allows the driver to pick the correct front buffer to display. To correct render stereo one should use the parallel axis asymmetric frustum perspective projection method as shown in this example. A good source of information on this technique is Paul Bourke's web site at <http://astronomy.swin.edu.au/~pbourke/opengl/stereogl/> A number of example surfaces used are by Roger Bagula with Paul Bourke contributing some of the surface rendering evaluation code. More renderings of these and other surfaces can be found at <http://astronomy.swin.edu.au/~pbourke/surfaces/>. Surface rendering is has the simple, yet very effective on Mac OS X v10.2 and later, optimization of being compiled in display lists in this example, though the required use of two sided lighting likely will slow the rendering down. Also, shown in this example is a simple, yet rotationally correct, track ball algorithm with was originally adapted from the NSGL Teapot example and converted to standard C code. Note: to view stereo one must use stereo glasses this example is designed to support stereographics glasses which require a blue sync line at the bottom of the screen (in lieu of hardware syncing). ProjectBuilder, Mac OS X 10.2.3 or later, stereo glasses to Requirements: see stereo presentation (recommended but not required). Keywords: OpenGL, stereo, GLUT, display list

Document Revision History

Date Notes
2003-02-20Shows how to use stereo with GLUT under Mac OS X v10.2.3 or later.

Did this document help you?
Yes: Tell us what works for you.
It’s good, but: Report typos, inaccuracies, and so forth.
It wasn’t helpful: Tell us what would have helped.