
We've included a command line utility called PLY2POP.EXE, which
is a program that converts a POLYRAY depth-encoded ray traced file 
into a file that is usable by POPOUT-PRO.

In his POLYRAY ray tracer, Alexander Enzmann was clever in that
he added the capability to save a ray traced image in a format that
contains information specifying the distance of each point from the 
viewer.  Unfortunately, this format is not quite compatible with 
the depth information that POPOUT-PRO expects in the Depth File.  
POLYRAY outputs a full-color, Type 2 Targa file with the depth 
encoded in the red and green channels.  PLY2POP reads one of these 
depth encoded files, and converts it to a Type 3 greyscale Targa 
file, where depth is represented as intensity; the brighter the 
intensity, the closer the point is to the viewer.  This is how
POPOUT-PRO expects depth to be encoded.

A suitable POPOUT Depth File can be created using POLYRAY 
Version 1.6a, by invoking it with the following command:
polyray cube.pi -o cube.tga -u -p z

The '-u' switch directs POLYRAY to output a Type 2 (uncompressed)
Targa file, and the '-p z' switch instructs it to include depth
information.

Note:
This depth format was not available in earlier versions of POLYRAY.
In later versions, Mr. Enzmann has changed the switch from '-p z'
to '-d'.  The result is the same.

PLY2POP can then be run from the DOS prompt to convert the image 
to a POPOUT-PRO compatible Depth File image with the following 
command:
ply2pop cube.tga depth.tga 

The above command generated a Type 3 Targa file.  PLY2POP will
automatically scale the input depth encoded image to maximize the
number of greyshades produced.  This Targa file can be read 
directly by POPOUT-PRO as a Depth File.

PLY2POP accepts 2 parameters.  The first parameter
is the file name of the Type 2 Targa image created by POLYRAY.
The second parameter is the filename of the file you want
PLY2POP to create (this will be your Depth File in POPOUT-PRO).

Note: POPOUT-PRO will not accept 256-color BMP files as valid Depth
Files.  For users who want to generate stereograms with more than 
16 levels, we move into a different category.  These more complex 
stereograms are more successful when the Depth File has been 
generated using a ray tracing program or high end drawing program.
If your drawing program creates 256-color BMP files, refer
to the BMP2TGA DOS utility that we've included on this diskette.

The following is a listing of a file called 'CUBE.PI', which
will create a simple cube using the POLYRAY ray tracer.  If you've
got POLYRAY, you may want to try this:

// create a simple cube using Alexander Enzmann's POLYRAY ray tracer
viewpoint {
   from <0, 35, 0>
   at <0,0,0>
   up <0,1,0>
   angle 20
   resolution 320, 240
   aspect 4/3
   }

background <0, 0, 0>
light <-50,10, -5>
light < 10,20, -10>

include "..\colors.inc"

object { box <-2, -2, -2>, <2, 2, 2> shiny_red rotate <25, -30, 35>}

