home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-387-Vol-3of3.iso / r / raylat10.zip / RAYLATHE.DOC < prev    next >
Text File  |  1993-03-27  |  5KB  |  142 lines

  1.  
  2.  
  3.  
  4.     RayLathe v 1.0 (c) 1993 Koehler
  5.  
  6.     DESCRIPTION:
  7.  
  8.      RayLathe is a text based tool that allows you to create three
  9.     dimensional objects using the metaphor of the carpenter's lathe.  The
  10.     objects are created as DECLAREd COMPOSITEs for POVRAY 1.0 (p.k.a.  DKB)
  11.     ray tracing program.  Hopefully future a version will support Vivid.
  12.  
  13.      The data is given as X, Y, THICK.  X and Y are the coordinates of
  14.     the end point of the line of a cut on the lathe.  THICK is the
  15.     thickness of the surface of the object.  This obviously differs from a
  16.     real lathe were the object is solid.  We can, however, do things a real
  17.     lathe can't:  undercut an area.  See example #2 below.  The values for
  18.     THICK are:    -1 for solid object (renders quickest, no undercutting
  19.     allowed), 0 for 'move to' (like starting a new block of wood a distance
  20.     from the current one), and anything greater than 0 for the actual
  21.     thickness of the shell of the object.  The last entry must be '-1 -1
  22.     -1' to signify end of object.
  23.  
  24.  
  25.     EXAMPLE #1
  26.  
  27.      We will make an object that looks like a pulley.  Figure A shows
  28.     the coordinates with lines showing the cut surface.  Figure B is the
  29.     data set for Figure A.  Figure C is a view of the pulley looking into
  30.     the groove.
  31.  
  32.        Fig. A           Fig. B             Fig. C
  33.  
  34.     5 |   *      *           2 1 0  <-note move-to    .    .
  35.     4 |   |\     /|           5 5 -1            |\     /|
  36.     3 |   | *---* |           3 3 -1            | .---. |
  37.     2 |   |      |           5 3 -1            |    |
  38.     1 |   *      *           6 5 -1            |    |
  39.       + - - - - - - - - -       6 1 -1            |    |
  40.     0    1 2 3 4 5 6 7 8 9       -1 -1 -1            | .---. |
  41.                                 |/     \|
  42.                                 .    .
  43.     EXAMPLE #2
  44.  
  45.      Contrary to a real lathe, this lathe can undercut surfaces.  For
  46.     example we can make something that looks [barely] like a sun umbrella.
  47.     Remember to use thickness when undercutting else the solid object will
  48.     fill in the inside of the umbrella.  Also, use a thickness of 0 when
  49.     moving from the tip of the umbrella (point 3) into the center (point 4)
  50.     when drawing the post (line between 4 and 5).
  51.  
  52.  
  53.  
  54.  
  55.        Fig. D                     Fig. E
  56.  
  57.  
  58.          3                      .
  59.            /                    / !
  60.         /                         /      !
  61.      /                      /      !
  62.       /                        /      !
  63.      2                          .       !
  64.      |4-----------------------------5          |-------------------------------
  65.      1                          |-------------------------------
  66.                           .       !
  67.                            \      !
  68.                           \      !
  69.                              \      !
  70.                             \ !
  71.                               .
  72.  
  73.  
  74.  
  75.     APPLICATION NOTES:
  76.  
  77.      Another program is included to convert uLathe (by Daniel S.  Baker
  78.     CompuServe:  71551,2300) .LAT files to .DAT files used by RayLathe to
  79.     generate the objects.  uLathe is an excellent object creator for
  80.     windows.  I was disappointed that the output was not usable by any of
  81.     the ray tracers for building whole scenes.    Ta-Da!    Hopefully RayLathe
  82.     code can be integrated as an export option for uLathe.
  83.  
  84.      The texture LatheWorkTex must be defined for the resulting object.
  85.     See the included example .POV file.  At the end of the file created by
  86.     RayLathe are two #declare's (Location and Look_At) which are vector
  87.     definitions for where to put the camera and where to aim the camera.
  88.     To use them in POVRAY:
  89.  
  90.     In steady of:   location <1 2 3>     you can use:    location Location
  91.             look_at <3 2 1>            look_at Look_At
  92.  
  93.  
  94.     Usage:   LAT2RAYL candle               <- Converts uLathe CANDLE.LAT
  95.          RAYLATHE <candle.dat >candle.inc  <- Creates candle object
  96.          Then just render candle.pov
  97.  
  98.  
  99.  
  100.  
  101.     ADDITIONAL BOTHER:
  102.  
  103.      See also CHAIN (which generates a chain of links), SHADE (which
  104.     generates pleated lamp shades), DIAMOND (which generates a cut gem,
  105.     plus creates the rest of the .POV file:  view, light, floor), GEAR
  106.     (guess), STAR (which generates 3D stars with several attributes),
  107.     FNT2POV (which converts Grasp/Pictor/compatible fonts to objects using
  108.     many options), and SHP2DKB (which should become SHP2PV) which takes
  109.     AutoCad .SHP font files and generates stroke-type font objects.
  110.  
  111.      With all of these programs, just play around with the variables to
  112.     generate new shapes.  For example, generating many long points on the
  113.     star looks like the spokes of a bicycle wheel.  Many short points on a
  114.     large radius star looks like a circular saw blade.    Use your
  115.     imagination and please post any ideas or neat works (with source) for
  116.     the world to enjoy.  As you can tell I don't like building single
  117.     objects; I'd rather build a factory that can spit out 'what if' objects.
  118.  
  119.      Trial size soap box:  Please include source when sending programs
  120.     or objects.  Even if its sloppy, it can only help others.  Follow the
  121.     lead of the people who brought us DKB in the first place.  We wouldn't
  122.     have a POVRAY now otherwise!  Many thanks to those who do post!
  123.  
  124.     I can be reached at YOU CAN CALL ME RAY RBBS (708) 358-5611.
  125.  
  126.  
  127.             "Its my world and you're welcome to it".
  128.  
  129.  
  130.                         Ken Koehler (3-26-93)
  131.                         CIS 72740,1161
  132.  
  133.     Enclosed are these files:
  134.  
  135.      RAYLATHE.C    C source
  136.      RAYLATHE.EXE  MS-DOS executable for object generator
  137.      RAYLATHE.DOC  This file
  138.      LAT2RAYL.C    C source
  139.      LAT2RAYL.EXE  uLathe .LAT to RayLathe .DAT converter
  140.      CANDLE.LAT    uLathe .LAT file containing shape data
  141.      CANDLE.POV    Sample POVRAY file to generate the test image
  142.