Triangular Glob Generator v1.0 copyright 1993, Dov Sherman (For use with Stephen Coy's Vivid Raytracer v1.0 or higher) ----------------------------------------------------------------------- GLOB is freely distributable. The author authorizes the distribution on this program over BBS's, networks, magnetic media, and any other forms I haven't thought of. The distributor may not charge more than $5 US for this software. GLOB may not be included in any commercial package without the explicit written consent of the author. Any distribution of this package must contain: GLOB10.EXE --- The executable GLOB10.DOC --- This file EXAMPLE.G --- An example GLOB input file EXAMPLE.V --- A Vivid studio file for the ouput from EXAMPLE.G EXAMPLE.GIF --- The eventual GIF result of EXAMPLE.G The author makes no guarantees or warranties with this program and claims no responsibility from damage or loss of time through the use of this program. No fee is due for the personal use of this program but I would like to see some examples of raytracings others do using this software. Also, if you really want to, you can send a few bucks to me at: Dov Sherman 316 East King Street Boone, NC 28608 Suggestions, questions, bug reports, and lavish praise should be sent to the above address. I can also be reached by Internet at DS5877@Stat.Appstate.Edu. ----------------------------------------------------------------------- GLOB is a handy utility for creating more realistic, rounded objects without relying on bezier patches (which are still good but hard to work out on paper). GLOB takes an ASCii file containing the coordinates and radii of a series of spheres and creates smooth connections between each sequential pair, connecting the first and third spheres in each sequential triple, and placing a triangular polygon over the gap created by a sequential triple. I'll try to explain this better later. The output is in the form of an include file for Stephen Coy's Vivid Raytracer. Other raytracer formats may be supported in future versions if I ever manage to figure out the other ones. ----------------------------------------------------------------------- Let's start by looking at an example from an input file. An input file is made up a series of numbers in groups of four in the form x y z r. For example, to describe a sphere at (-4, 0, -4) with a radius of 4, the appropriate form would be -4 0 -4 4 If the lines directly preceding and following the sphere definition are not sphere definitions, the sphere will be alone. If the definition is followed by one additional sphere definition, as in: -4 0 -4 4 2 5 -3 3 Both spheres are printed with an additional cone connecting at tangential points to the spheres to create an oblong capsule shape. If one of the spheres has a radius of zero, that sphere will not be printed but the cone will be printed as connecting at a tangential point on the remaining sphere with a sharp point on the other end, like a buoy. But the really nice feature is when three sphere definitions appear in sequence, as in: -4 0 -4 4 2 5 -3 3 1 -8 -2 2 When three sphere definitions appear in sequence, the second and third spheres are connected by a cone, then the first and third are connected by a cone, then a triangular polygon is placed over the hole remaining in the triangle made by the spheres and cones. This creates a triangular glob shape. You can use groups of these globs to create rounded objects based on groups of key spheres. When you run the program, it will created three extra files named oldsphr.$$$, oldcones.$$$, and oldtri.$$$ in which past spheres, cones, and triangles are stored. Each time a sphere, cone, or triangle comes up, it is checked against those stored in these files. In this way, no sphere, cone, or triangle is printed more than once. ----------------------------------------------------------------------- Command line format: glob [] [] output file defaults to input file with .vo extension valid switches are: /sx:n Scale-X = N /sy:n Scale-Y = N /sz:n Scale-Z = N /sr:n Scale-Radius = N /ox:n Offset-X = N /oy:n Offset-Y = N /oz:n Offset-Z = N /or:n Offset-Radius = N /d[:file] Turns on definition file with optional naming of the file which defaults to output file name with .def extension /v Turns on EGA 640x350x16 on-screen graphing Using the /s* switches causes input from the input file to be scaled in the given dimension by that number before processing. Using the /o* switches causes input from the input file to be offset in the given dimension by that number before processing. Using the /d switch causes a second output file to be created which will contain the #define calls to define the values for sphere, cone, and triangle definitions in the main output file. In the input file, you name the define name for a group on primitives by placing the name on a line by itself prepended by a pound sign (#). For example, if you wanted the definition name to be "face", you would have a line saying: #face Each successive definition will be named face1, face2, face3, face4 and so on. You can change the definition name to be used by simply naming it again on another line. If, at some later point, you change back to the first definition name, the suffix numbers will continue to increment after the last suffix from the previous use. If you place a pound sign (#) on a line by itself with no name after it, it will stop definition use until the next definition definition. Of course, all pound sign functions are ignored unless the /d switch is used at the command-line. Using the /v switch will turn on EGA 640x350x16 on-screen graphing of the spheres, cones, and triangles as they are processed. This helps you spot when you've put a sphere in the wrong location. If you don't have EGA, don't use this switch. Other graphic modes may be supported in future versions. ----------------------------------------------------------------------- Take a look at the example input file example.g. If you were to run it through GLOB with the /d option on to create output files example.vo and example.def and then use Vivid to process example.v (which #includes example.vo and example.def), the result would be the included example.gif. ----------------------------------------------------------------------- Triangular Glob Generator v1.0, copyright 1993, Dov Sherman