home *** CD-ROM | disk | FTP | other *** search
/ In'side Shareware 1994/1995 January / ish194-95.iso / stereo / popout / ply2pop.txt < prev    next >
Text File  |  1994-03-27  |  4KB  |  86 lines

  1.  
  2. We've included a command line utility called PLY2POP.EXE, which
  3. is a program that converts a POLYRAY depth-encoded ray traced file 
  4. into a file that is usable by POPOUT.
  5.  
  6. In his POLYRAY ray tracer, Alexander Enzmann was clever in that
  7. he added the capability to save a ray traced image in a format that
  8. contains information specifying the distance of each point from the 
  9. viewer.  Unfortunately, this format is not quite compatible with 
  10. the depth information that POPOUT expects in the Source File.  
  11. POLYRAY outputs a full-color, Type 2 Targa file with the depth 
  12. encoded in the red and green channels.  PLY2POP reads one of these 
  13. depth encoded files, and converts it to a Type 3 greyscale Targa 
  14. file, where depth is represented as intensity; the brighter the 
  15. intensity, the closer the point is to the viewer.  This is how
  16. POPOUT expects depth to be encoded.
  17.  
  18. The EXAMPI2.BMP file was created by first using POLYRAY, invoking
  19. it with the following command:
  20. polyray cube.pi -o cube.tga -u -p z
  21.  
  22. The '-u' switch directed POLYRAY to output a Type 2 (uncompressed)
  23. Targa file, and the '-p z' switch instructed it to include depth
  24. information.
  25.  
  26. PLY2POP was then run to convert the image to a POPOUT-compatible
  27. image with the following command:
  28. ply2pop cube.tga exampi2.tga 
  29.  
  30. The above command generated a Type 3 Targa file.  PLY2POP will
  31. automatically scale the input depth encoded image to maximize the
  32. number of greyshades produced.  This Targa file can be read 
  33. directly by POPOUT as a Source File.  To make the image viewable 
  34. using Paintbrush (which can't read Targa format), we converted 
  35. it to BMP using the TGA2BMP utility with the following command:
  36. tga2bmp exampi2.tga exampi2.bmp 256
  37.  
  38. Note that by doing this, you can view the EXAMPI2 image with
  39. Paintbrush, but it is no longer suitable as a POPOUT Source 
  40. File.
  41.  
  42. PLY2POP accepts 2 parameters.  The first parameter
  43. is the file name of the Type 2 Targa image created by POLYRAY.
  44. The second parameter is the filename of the file you want
  45. PLY2POP to create (this will be your Source File in POPOUT).
  46.  
  47. The EXAMPO3.BMP and EXAMPO4.BMP files were created using the
  48. registered version of POPOUT, with EXAMPI2.TGA as the Source File.
  49. We converted the EXAMPO3 and EXAMPO4 POPOUT Destination FIles to 
  50. BMP format just so Paintbrush can read them.
  51.  
  52. Note: POPOUT will not accept 256-color BMP files as valid Source
  53. Files.  There is actually a reason for this.  The vast majority
  54. of POPOUT users generate their Source File drawings using
  55. Paintbrush.  That's a fact.  Since Paintbrush can only save
  56. 16 unique colors (the rest are just dithered versions of the
  57. fixed set of 16), we decided that life would be much easier if
  58. POPOUT only accepts 16-color BMP images.  For users who want
  59. to generate stereograms with more than 16 levels, we move into
  60. a different category.  These more complex stereograms are more
  61. successful when the Source File has been generated using a 
  62. ray tracing program of some sort.  The format of choice of
  63. the popular ray tracers is Targa.
  64.  
  65. The following is a listing of the 'CUBE.PI' file used to
  66. create the image using POLYRAY:
  67.  
  68. // create a simple cube using Alexander Enzmann's POLYRAY ray tracer
  69. viewpoint {
  70.    from <0, 35, 0>
  71.    at <0,0,0>
  72.    up <0,1,0>
  73.    angle 20
  74.    resolution 320, 240
  75.    aspect 4/3
  76.    }
  77.  
  78. background <0, 0, 0>
  79. light <-50,10, -5>
  80. light < 10,20, -10>
  81.  
  82. include "..\colors.inc"
  83.  
  84. object { box <-2, -2, -2>, <2, 2, 2> shiny_red rotate <25, -30, 35>}
  85.  
  86.