home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ray Tracing Box
/
RAY_CD.mdf
/
raytrace
/
cullar
/
cull.doc
< prev
next >
Wrap
Text File
|
1993-03-28
|
5KB
|
144 lines
CULL
────
Usage: CULL infile.POV outfile.INC
WHAT IT DOES
──── ── ────
CULL searches the file infile.POV for any #include statements. It takes
takes the #declare statements found in the include files listed by these
#include's and produces a list of declared elements. Then CULL searches
infile.POV for any elements that match those in the declared elements list.
Finally, CULL produces a file named outfile.INC with all the matching declare
statements.
For example, lets say you have a POV file named SAMPLE.POV and that this
file contains the following statements:
// Persistence of Vision Raytracer
#include "shapes.inc"
#include "shapesq.inc"
#include "colors.inc"
#include "textures.inc"
#include "stones.inc"
...
...
texture { Red_Marble }
...
texture { Blue_Agate }
...
intersection { Disk_X
...
If you execute CULL with the following arguments:
CULL SAMPLE.POV SAMPLE.INC
CULL will produce the file SAMPLE.INC with these lines:
#declare Cylinder_X = quadric {
<0.0 1.0 1.0>
<0.0 0.0 0.0>
<0.0 0.0 0.0>
-1.0
}
#declare Disk_X = intersection { /* Capped cylinder, Length in x axis */
quadric { Cylinder_X }
plane { <1.0 0.0 0.0> -1 inverse }
plane { <1.0 0.0 0.0> 1 }
}
#declare Red_Marble = texture {
marble
turbulence 1.0
colour_map {
[0.0 0.8 colour red 0.8 green 0.8 blue 0.6
colour red 0.8 green 0.4 blue 0.4]
[0.8 1 colour red 0.8 green 0.4 blue 0.4
colour red 0.8 green 0.2 blue 0.2]
}
}
#declare Blue_Agate = texture {
agate
colour_map {
[0.0 0.5 colour red 0.30 green 0.30 blue 0.50
colour red 0.30 green 0.30 blue 0.50]
[0.5 0.55 colour red 0.30 green 0.30 blue 0.50
colour red 0.20 green 0.20 blue 0.30]
[0.55 0.6 colour red 0.20 green 0.20 blue 0.30
colour red 0.25 green 0.25 blue 0.35]
[0.6 0.7 colour red 0.25 green 0.25 blue 0.35
colour red 0.15 green 0.15 blue 0.26]
[0.7 0.8 colour red 0.15 green 0.15 blue 0.26
colour red 0.10 green 0.10 blue 0.20]
[0.8 0.9 colour red 0.10 green 0.10 blue 0.20
colour red 0.30 green 0.30 blue 0.50]
[0.9 1 colour red 0.30 green 0.30 blue 0.50
colour red 0.10 green 0.10 blue 0.20]
}
}
Notice that the declaration "Cylinder_X" was listed because it was found
in "Disk_X."
Now you can replace the multiple #include's with one statement:
#include "SAMPLE.INC"
It is a good idea to leave your old #include statements in your file
by commenting them out (/* */). Since CULL ignores comment characters,
this will allow you to make a new composite include file if you change the
declared elements you are using. You should remove the statement that
names outfile.INC when rerunning CULL however.
CULL allows you to boil down up to 16 .INC files containing up to 1000
declare elements into one small file using only the necessary declare state-
ments. The will allow you more memory for your precious work of art.
A NOTE ON SUBDIRECTORIES
─ ──── ── ──────────────
If you keep your include files in a separate subdirectory, CULL will
not be able to find them. Make sure that CULL.EXE, infile.POV and all the
necessary .INC files are in the same directory before running CULL.
SOURCE FILE
────── ────
The file CULL.BAS is the source file for CULL.EXE. The program was
written and developed with Microsoft Basic Professional Development
System 7.0 and the Quick Basic Extended environment. The program should be
compatible with Quick Basic 4.5. I'd like to hear from anyone with QB45 to
see if this file works with the QB45 system.
BUGS
────
Right now there is only one known bug that I am aware of. If you use a
declared element that contains a substring of another element, CULL will
write both sets of declare statements. For example, if you were to use the
element "OldGold" CULL will write the following:
#declare Gold = colour red 0.8 green 0.498039 blue 0.196078
#declare OldGold = colour red 0.81 green 0.71 blue 0.23
WHERE TO FIND THE AUTHOR
───── ── ──── ─── ──────
Whether you find this program useable or unusable, useful or a waste
of precious download time, I'd like to hear your comments. I'm on the
Chicago Ray-Trace BBS and Compuserve [71574,1514].
Happy Traces!!!
Robert Geissler
Baton Rouge, LA
March 1993