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 >
Wrap
Text File
|
1993-03-27
|
5KB
|
142 lines
RayLathe v 1.0 (c) 1993 Koehler
DESCRIPTION:
RayLathe is a text based tool that allows you to create three
dimensional objects using the metaphor of the carpenter's lathe. The
objects are created as DECLAREd COMPOSITEs for POVRAY 1.0 (p.k.a. DKB)
ray tracing program. Hopefully future a version will support Vivid.
The data is given as X, Y, THICK. X and Y are the coordinates of
the end point of the line of a cut on the lathe. THICK is the
thickness of the surface of the object. This obviously differs from a
real lathe were the object is solid. We can, however, do things a real
lathe can't: undercut an area. See example #2 below. The values for
THICK are: -1 for solid object (renders quickest, no undercutting
allowed), 0 for 'move to' (like starting a new block of wood a distance
from the current one), and anything greater than 0 for the actual
thickness of the shell of the object. The last entry must be '-1 -1
-1' to signify end of object.
EXAMPLE #1
We will make an object that looks like a pulley. Figure A shows
the coordinates with lines showing the cut surface. Figure B is the
data set for Figure A. Figure C is a view of the pulley looking into
the groove.
Fig. A Fig. B Fig. C
5 | * * 2 1 0 <-note move-to . .
4 | |\ /| 5 5 -1 |\ /|
3 | | *---* | 3 3 -1 | .---. |
2 | | | 5 3 -1 | |
1 | * * 6 5 -1 | |
+ - - - - - - - - - 6 1 -1 | |
0 1 2 3 4 5 6 7 8 9 -1 -1 -1 | .---. |
|/ \|
. .
EXAMPLE #2
Contrary to a real lathe, this lathe can undercut surfaces. For
example we can make something that looks [barely] like a sun umbrella.
Remember to use thickness when undercutting else the solid object will
fill in the inside of the umbrella. Also, use a thickness of 0 when
moving from the tip of the umbrella (point 3) into the center (point 4)
when drawing the post (line between 4 and 5).
Fig. D Fig. E
3 .
/ / !
/ / !
/ / !
/ / !
2 . !
|4-----------------------------5 |-------------------------------
1 |-------------------------------
. !
\ !
\ !
\ !
\ !
.
APPLICATION NOTES:
Another program is included to convert uLathe (by Daniel S. Baker
CompuServe: 71551,2300) .LAT files to .DAT files used by RayLathe to
generate the objects. uLathe is an excellent object creator for
windows. I was disappointed that the output was not usable by any of
the ray tracers for building whole scenes. Ta-Da! Hopefully RayLathe
code can be integrated as an export option for uLathe.
The texture LatheWorkTex must be defined for the resulting object.
See the included example .POV file. At the end of the file created by
RayLathe are two #declare's (Location and Look_At) which are vector
definitions for where to put the camera and where to aim the camera.
To use them in POVRAY:
In steady of: location <1 2 3> you can use: location Location
look_at <3 2 1> look_at Look_At
Usage: LAT2RAYL candle <- Converts uLathe CANDLE.LAT
RAYLATHE <candle.dat >candle.inc <- Creates candle object
Then just render candle.pov
ADDITIONAL BOTHER:
See also CHAIN (which generates a chain of links), SHADE (which
generates pleated lamp shades), DIAMOND (which generates a cut gem,
plus creates the rest of the .POV file: view, light, floor), GEAR
(guess), STAR (which generates 3D stars with several attributes),
FNT2POV (which converts Grasp/Pictor/compatible fonts to objects using
many options), and SHP2DKB (which should become SHP2PV) which takes
AutoCad .SHP font files and generates stroke-type font objects.
With all of these programs, just play around with the variables to
generate new shapes. For example, generating many long points on the
star looks like the spokes of a bicycle wheel. Many short points on a
large radius star looks like a circular saw blade. Use your
imagination and please post any ideas or neat works (with source) for
the world to enjoy. As you can tell I don't like building single
objects; I'd rather build a factory that can spit out 'what if' objects.
Trial size soap box: Please include source when sending programs
or objects. Even if its sloppy, it can only help others. Follow the
lead of the people who brought us DKB in the first place. We wouldn't
have a POVRAY now otherwise! Many thanks to those who do post!
I can be reached at YOU CAN CALL ME RAY RBBS (708) 358-5611.
"Its my world and you're welcome to it".
Ken Koehler (3-26-93)
CIS 72740,1161
Enclosed are these files:
RAYLATHE.C C source
RAYLATHE.EXE MS-DOS executable for object generator
RAYLATHE.DOC This file
LAT2RAYL.C C source
LAT2RAYL.EXE uLathe .LAT to RayLathe .DAT converter
CANDLE.LAT uLathe .LAT file containing shape data
CANDLE.POV Sample POVRAY file to generate the test image