home *** CD-ROM | disk | FTP | other *** search
- SEGA GLASSES INTEFACE FOR THE RS232 PORT
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
- Comments/enquiries/money(8-)) to:
-
- Glen Harris
- glen@wench.ece.jcu.edu.au
- James Cook University of North Queensland
-
-
- This is some of the gear I have written for the Sega 3D glasses.
- It includes a circuit for the glasses interface, which allows the two
- lenses to be controled completely separately.
- We have a number of pins in an RS232 interface that can be used for
- output, so why not use them, if it does not complicate the circuit.
- It can also be useful in some situations if both lenses can be clear
- or dark at the same time.
-
- With the circuit is a fairly easy to understand description of how
- LCD's work and how to get current to flow in both directions without
- having a +10V / 0V / -10V supply.
-
- All the info below is IBM PC specific, but can be easily ported by
- anyone with a little experience.
- --------
- Also in the file is a _very_ simple program showing how to actually
- make the glasses flip between one lens and the other.
-
- In a number of other files is a stereo viewer, which uses Mode X on
- a VGA card to display 320x400x256 images. The Mode X stuff was written
- and posted by F van de Hulst from Programmer's Journal, so I've left it
- separate from my code.
-
- The basic theory is: read the left image into one page(0), the other
- image in to the other page(1), and then display each, while swapping
- lenses. All this is synched with the vertical retrace to reduce flicker.
-
- If done fast enough(>~15Hz), the effect will be invisible to the human
- eye.
-
- Try experimenting by taking out the WaitForVerticalRetrace() calls,
- reversing the pages, or adding small delays so a couple of retraces are
- skipped.
-
- There is a sample image file, consisting of a pyramid of balls in front of
- a larger ball on a checker floor, with different surface properties. The
- image was made with RayShade 4.0, using the -l and -r options, which is much
- easier than calculating viewpoints by hand.
-
- The image format is a multi-image GIF file, the left image first. There
- is a global palette, and no local palettes. If there are errors in the
- GIF reading or decoding, error messages will give a fair idea of what is
- wrong.
-
- Local color maps will halt the program as the images should have the same
- palettes. Local maps should only be present when the images have different
- maps, so their prescence is a good indication that t least one image will
- look totally disgusting. The -i flag will tell the program to ignore the
- local maps and use the global one.
-
- The -p <mapfile> option will make the program read specified file for
- the colormap. The format is one entry per line in "R G B" format, ala
- Fractint or PICLAB. The entries are three integers ranging from 0 to 255.
-
- Since the mapfile is read in after the image, it's colors only come into
- effect just before 3D mode kicks in.
-
- If a global color map is not found, the program uses the first local map, if
- present, or, if not, the second. If none are found, a grey scale is used,
- ranging 0 to 63 with a gradient of one color per four map entries.
-
- Grey scaling of the global or local color map can be forced with the -g
- option. A 'mode co80' call may be needed to reset the screen after using
- this option.
-
- The -b option can be used to keep the screen blank until decoding is
- finished.
-
- If you can't understand the method of reading a GIF image (not the LZW
- decoding, I don't understand it myself), mail me and I'll explain the steps
- involved.
-
- The LZW decoding code was written by Steven A. Bennett. His copywrite
- notice appears in dgif.c. The files dgif.c and dgif.h were re-organised to
- have the same coding style as I use, so they may look a little different to
- people who have seen them before.
-
- FILES:
-
- circuit.lcd : Circuit, LCD info and simple program
-
- segavga.c : VGA viewer for IBM PC's.
- segavga.h
-
- dgif.c : Gif image decoder for above.
- dgif.h Written by Steven A. Bennett.
-
- mode_x.c : Mode X pixel writing, paging and retrace timing code.
- mode_x.h Written by F van der Hulst.
-
- getopt.c : AT&T public domain getopt. Don't know who obtained it.
-
- makefile : Makefile for the above program.
- readme : This file.
-
- mball.gif : Sample raytraced image.
- room.gif : And another.
- sample.map : An example greyscaled color map of room.gif.
-
- split.c : Program to split a .img file into two Targa files.
- add.c : Program to make two GIFs into a multi image GIF file.
-
-