[comp.graphics.visualization] Stereo Viewing

andyrose@batcomputer.tn.cornell.edu (Andy Rose) (11/20/90)

Stereo Viewing Interface for Workstations

Bruce Land
Catherine Devine

Theory Center Technical Report

Cornell Theory Center, Cornell University, Ithaca NY 14853-3801
CTC90TR27  10/90

Introduction
Three dimensional data sets are becoming widespread in scientific
simulations and analysis of physical systems.  Applications ranging from fluid
simulations to medical imaging require understanding of three dimensional
data.  Researchers oftenproduce images from data to aid in understanding.  In 
the resulting images, monocular depth cues such as object size, parallax
motion, and shading help to interpret 3D data.  However, viewing 3D
data is enhanced by using stereo pairs so that binocular depth cues are
available.  There are several schemes for producing stereo pairs on the
screen of a workstation (e.g. liquid crystal shutters, vibrating mirros or
cylindrical lens).  We describe here a liquid crystal shutter system which
is easy and inexpensive to construct.

Using liquid-crystal shutter glasses designed for video games it is 
possible to construct an inexpensive stereo viewing interface to any personal
computer or workstastion which has hardware double-buffering of the 
display screen and which can produce an rs-232 character.  The resulting
display exhibits strong stereo depth cues.  Flicker is noticable and
depends on the refresh rate of the monitor as well as the speed with
which the double-buffered display can be changed.  On the IBM RISC System
6000, equipped with the GL display card the flicker is moderate, the
brightness good, and the stereo effect very stable.

The description given here will assume an IBM RS 6000.  There are two parts
to the system; the software to display two images in the double buffer
and the hardware with converts an RS-232 character to the waveform necessary to
drive the liquid-crystal glasses.  Clearly the software will have to be
modified for other systems, although it should run virtually unmodified
on Silicon Graphics machines, such as the personal IRIS.

HArdware.
The interface to convert a series of RS-232 characters to the waveform required
to control the glasses consists of four CMOS integrated circuits.  The
logic diagram is shown in figure 1.  As shown the incoming RS-232 pulses
are clipped and shifted into CMOS range, then passed through a one-shot
multivibrator to debounce and stretch the character so that each character
produces one 5 millisecond pulse.  The resulting pulse toggles a type D flip-
flop, once per pulse.  The two complementary outputs of the flip-flop
select which shutter will be dark.  A pair of and gates combines the select
lines and the output from a 2 kHz oscillator.  The oscillator is more
efficient than DC at making the glasses dark.  Figure 2 shows the schematic
for the interface.  Nothing in the layout is critical.  CMOS logic
was used because it is very low current and because it was compatible with
the 18 volts necessary to drive the glasses.  The input conditioning 
circuit uses a capacitor to shift voltage levels and diodes to clip
the RS-232 signal to fall within CMOS logic levels.

SOftware.
The RS6000 must have an RS-232 port configured before running the interface
software.  We use either /dev/tty0 or /dev/tty1 set to the SMIT (system
management interface tool) defaults, with logins disabled.  We used an IBM
serial printer cable (which has pins 1-8 and 20 and transmits on
pin 3).  Other cables probably require different pin jumpers.  Plug the
RS-232 cable into the workstation and interface circuit before running any
code.

The software itself is very simple.  Open the RS-232 port, configure the
workstation for 24 bit color and double-buffering, load the first image
into a frame buffer, swap buffers and load the second, and then swap the
buffers continuously, sending a character out the RS-232 port with each
swap.  Since the system does not attempt to synchronize left-right
shutter with left-right image, the left mouse button inserts an extra
character on the RS-232 control line to flip left-right phase.  The right
mouse button causes the program to exit.  Figure 3 is sample code for RS6000.

Applications.
The stereo adaptor has been used to examine data sets resulting from 3D
simulations of a comet (Bollens 1990).  The volume-rendering comet data was
much easier to understand using the stereo adaptor because of the absence
of strong monocular depth cues, such as linear perspective and object size.  In
general, volume rendered 3D fields seem to benifit from stereo rendering
because of the often arbitrary shapes of the isosurfaces.  To make the 
stereo pairs we rendered the 3D objects twice, rotating the view points around 
the objects approximately 0.07 radians.  See figure 4 for a stereo example
with can be viewed with cross eyes.  The circuit and software described
are inexpensive and easy to implement.  Researchers have found stereo
viewing to be essential in the understanding of 3D data sets.

Sources and a warning.
We obtained glasses from two sources.  SEGA game glasses can be obtained
at a variety of retail outlets where video games are sold.  The SEGA glasses
are very dark to minimize flicker as flicker fusion frequency increases
with light intensity.  We prefer to break the filter off with pliers
and use only the shutters.  wThe second source is the 3DTV company
PO Box 13059, San Rafael, CA).  3DTV sells glasses which are made for
adults (unlike the SEGA glasses) and have lighter filters which can
be easily removed.  

There is some evidence to suggest that a few epileptic individuals who are
susceptible to rhythmic flickering may be at risk by using the device
described here.

Acknowledgements.
This work was conducted using the Cornell National Supercomputer Facility,
a resource of the Cornell Theory Center, which is funded in part by the
National Science Foundation, New York State, IBM and members of the Theory
Center's Corporate Research Institute.

References.
Bollens, Ross, "Three dimensional Simulation Studies of Active Experiments in
Space Plasmas" Dissertation, UCLA, in preparation 1990.

Figure 1 RS-232 to Sega Glasses logic description 

RS-232 character.  Several -12 to +5 volt pulses in about 3 msec.
|
|
RS-232 Conditioning
|
| Burst of pulses clamped to 0.0 to approx 12 volts.
|
one shot with 5msec time constant
|
| One pulse per RS-232 character, at CMOS logic level
|
flip,flop, toggles once per RS-232 pulse
|                            |
| left select                |  right select
|                            |
and gate  <- 2 kHz oscillator->and gate
|                              |
left glass shutter           right glass shutter


Figure 3 sample code 
#include <gl.h>
#include <device.h>
#include <stdio.h>

int pixarray[YMAXSCREEN +1][XMAXSCREEN +1];

main (argc,argv)
int argc;
char **argv;
{
  FILE *f1;

  f1 = fopen ("/dev/tty1","w");

  maxsize (XMAXSCREEN, YMAXSCREEN);
  winopen ("3D image");
  fullscrn();
  RGBmode();
  doublebuffer();
  gconfig();
  RGBcolor (0,0,0);
  clear():

  read_pixs (argv[1]);
  
  lrectwrite (0,0,XMAXSCREEN, YMAXSCREEN, pixarray);

  swapbuffers();
  clear();
  read_pixs (argv[2]);
  lrectwrite (0,0,XMAXSCREEN, YMAXSCREEN, pixarray);
  
  while (1){
   if (getbutton (RIGHTMOUSE)) {
   endfullscrn();
   fclose(f1);
   return;
   }

   if (getbutton (LEFTMOUSE)) fputs ("A\n", f1);

   swapbuffers();
   fputs ("a\n",f1);
  }
}


[ for hardcopy of this report with figure 2 (schematic of controller)
  e-mail Ann Redelfs,  redelfs@theory.tn.cornell.edu ]

V for vis.


-- 
Andrew Newkirk Rose '91 Department of Visualization CNSF/Theory Center
632 E & T Building, Hoy Road Ithaca, NY 14583  
607 254 8686  andy@cornellf.tn.cornell.edu