John Zelle has contributed to Visual code that handles both "active" and
"passive" stereo, and this is now available in the Windows version of
VPython (Linux/Unix to follow quickly). Many thanks to John. Also thanks
to Hugh Fisher who contributed to an earlier version of "active" stereo
and to the design.
This new capability is quite fantastic. Old demos leap out of the screen
at you, with the addition of a single line of code!
From the new documentation for displays:
scene.stereo
Stereoscopic option; scene.stereo = 'active' will render alternating
left eye/right eye images for viewing through shutter glasses if the
graphics system supports quad buffered stereo.
Setting scene.stereo = 'passive' will render a scene with double window
width, for display using two polarized projectors (with viewing using
simple passive polarized glasses for stereo).
If stereo equipment is not available, setting the option has no effect,
and scene.stereo will have the value 'nostereo'.
(Quad buffered 'active' stereo is only available on specialised graphics
systems that have the necessary hardware and shutter glass connector,
such as SGI machines and PCs with nVidia Quadro or 3DLabs Wildcat
graphics cards. It generates the illusion of depth by rendering each
frame twice from slightly different viewpoints corresponding to the left
and right eyes. Special shutter glasses are synchronised with the
alternating images so that each eye sees only the matching frame, and
our brains do the rest. It's called 'quad buffered' because there is an
OpenGL buffer per eye, both double-buffered for smooth updating.
'Passive' stereo requires a video card that can drive two monitors, or
two projectors.)
scene.stereodepth
By default, the front of the scene is located at the location of the
physical screen, which reduces eye strain. Setting scene.stereodepth = 1
moves the center of the scene to the location of the physical screen,
with the front half of the scene seeming to stick dramatically out of
the screen. scene.stereodepth = 2 moves the scene fully in front of the
physical screen, for maximally dramatic stereo effect.
Note: There is work in progress to implement "anaglyph" stereo (red/blue
glasses) , but this isn't quite ready.
Small detail: stonehenge.py has been slightly altered to remove the
crosshairs, which got in the way if you add stereo. None of the standard
demos have stereo turned on, but this is trivially easy to do.
Bruce Sherwood
|