3DPath v1.00 Copyright (c) 1994 by Keith Vertanen, Scott Perowitz & Aleksey Przhelyaskovskiy What it does: ----------------- 3DPath is a utility to assist in the creation of animation sequences using the Persistence of Vision ray tracer. With 3DPath you can create animations in which the viewer appear to "fly" through the scene. 3DPath computes a smooth b-spline path through a scene given a set of control point values. 3DPath reads in your POV script file and creates a specified number of output script files that have the viewpoint position and look at directions changed to the smooth path. 3DPath can also create a batch file that can be used to run the generation of the frames with POV. How it works: ----------------- The required command line parameters are as follows: 3DPath point file[.3d] script file[.pov] The optional switches are: -f(# frames) how many frames to generate (default 100) -b(filename) create output batch file (filename optional) -d(filename) example batch file to base output on -o(filename) override filename for the output scripts -p(#) degree of polynomial for spline (default 3) -xy -xz -yz view curve in xy, xz, or yz plane without generating scripts -l(x,y,z) use static look_at vector of x,y,z (i.e. -l100,50,25) -t create test script with path as spheres Point file is a plain text file that contains the control point values for the curve. 3DPath expects one control point per line, each coordinate should be separated by white space. For example: 10 20 30 100 70 46 -75 -20 134 Note: If the last point is the same as the first point, 3DPath will assume you want a smooth closed path, and will insert an extra control point colinear with the first and second control points. This extra point will be the same distance from the first point as the distance between the first and second point. Script file is the POV script scene file that you are animating. 3DPath will find the camera section of the script and replace the position and look at directions in all the output script files (NOTE: the location section should precede the look_at section). The output script files will be named the same as the input script but with numbers appended to the eight character filename (if your input script filename is too long to allow the specified number of frames, 3DPath will chop off the necessary characters). Optional switches: -f Specifies how many output script files to create (-f120 would create 120 script files). -b Tells 3DPath to create an output batch file. If you do not specify a explicit filename for the batch file, 3DPath will use the input script filename. -d Specifies the batch file to base the output batch file upon. Without this switch, 3DPath uses the supplied example batch file 3DSAMPLE.BAT. The example batch file consists of whatever commands you want to be performed when generating the frames (running POV, compressing the targa, or whatever). 3DPath repeats the contents of the example batch file once for each output frame. 3DPath parses the example file and replaces any tildes: ~ with the filename of the current frame number (foo001, foo002, etc). -o Allows you to override the default name used for the output scripts (-ofoo would create output scripts named foo001, foo002, etc). Without the -o switch, 3DPath will name the output scripts after the source script. -p Specifies what degree polynomial to use for spline curve. 3DPath defaults to using a cubic spline (degree 3). Play around with it if you're feeling adventurous. -xy, -xz, -yz Draws the projection of the spline in the specified plane. Use this to get a feel for what the curve will look like. No output script files are generated if one of these switches is used. -l Make the camera look_at vector to the supplied point all the time. Normally the look_at vector is pointed at the next point along the spline path, but with this switch, the camera centers on a fixed point and "hovers" around it on the spline path. -t Creates a test script file, placing red spheres along the path specified by your point file. This is good for checking whether your path is running into objects or behaving strangely. The test script file will be named after your source script but will have _3D tacked to the end of the filename. Tips: ----------------- 1. Use the projection and test script options to make sure the path you define is what you want. Nothing is more annoying then realizing you hit a wall after generating frames for a week and a half. 2. Consecutive control points at the same location will attract the spline curve closer. This is good for getting through tight spots in the scene. Remember, the b-spline curve only goes through the first and last control points, not the intermediate ones. 3. Generation of frames is somewhat slow. There are good ways we good have speed things up, but we decided to release something we knew was going to work. For now, running a disk cache software seems to help (besides, we figure ray tracers are inherently patient anyway). 4. Look both ways before crossing the street. 5. If you form a closed path by making the last point equal the first, I wouldn't have any other control points too close to the last one. 3DPath inserts the smoothing point at an distance equal to the distance from the first to the second point. If you have other control points at the end of the point list closer then this, you head may very well explode (actually the curve will just get confused, though if your head explodes its not our fault- see legal disclaimer below). 6. Unfortunately, due to how the splines where implemented, you will get more frames in sections of the path where the control points are closer together then in the section where they are far apart. It's not clear how to do the math so everything comes out even (if anybody has an idea, send me mail). For now, just try and space your control points evenly and use the projection views to see how it is working. 7. Be aware that doing animations in which the viewpoint moves creates _much_ bigger output animations then normal object moving animations. This is probably because the .FLI's can't be compressed nearly as much since there isn't the static background image that is present in object animations. If you want your animations to display smoothly, you better have enough memory to load the whole sucker in, otherwise it swaps to disk. 8. In case you're new to this animation thing, here's a list of the utilities we used for our animations: Persistence of Vision by the POV-Team DTA (Dave's Targa Animator) by David Mason Play (SVGA .FLI viewer) by Trilobyte Use POV to create the individual frames. Use DTA to merge the targa frames into an .FLI file. Use PLAY to display them on your screen. Its just that easy... Here's a list of sources for POV (and probably the other utilities as well): You Can Call Me Ray in Chicago (708) 358-5611 The Graphics Alternative in El Cerrito, CA (510) 524-2780 Pi Squared in Maryland (301) 725-9080 Anonymous FTP from alfred.ccs.carleton.ca (134.117.1.1) Program notes: ----------------- 3DPath may be freely used and distributed. Source code is included and may be modified for your own personal use. Please contact the author(s) before releasing any modified versions. 3DPath was created as a final project for our Computer Graphics class at the University of Minnesota: Morris. It was conceived of, written, and released within the two weeks prior to finals. As such, some bugs probably slipped through our extensive testing process :). Send any bug reports, suggestions or warm fuzzies to: vertankd@cda.mrs.umn.edu Kudos go to the POV-Team for their most excellent ray tracing software. Also special thanks to Piotr Szlenk for spending a "non-trivial" amount of time explaining splines to me. Lawyer repellent: ----------------- Keith Vertanen, Scott Perowitz & Aleksey Przhelyaskovskiy shall not be held responsible for any damage incurred to the user, or to the user's hardware, software, or peripheral devices during the operation of the 3DPath program. If you choose to use this program, you do so at YOUR OWN RISK. It is possible that errors have been in the code which could result in data loss. If you do not wish to take this chance, then by all means delete this software from your system now.