home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Ray Tracing Box
/
RAY_CD.mdf
/
raytrace
/
flg
/
frgen.doc
< prev
next >
Wrap
Text File
|
1993-10-02
|
10KB
|
209 lines
Fractal Landscape Generator v1.4
Copyright (c) 1993 Steve Anger
This program is freely distributable
FRGEN is a utility to generate fractal landscapes and other shapes
using successive triangle sub-division. The fractal data can be output
as POV-Ray or Vivid scene files or as raw triangle data. FRGEN only
generates flat faceted triangles. To produce smoothed fractals you
can output the fractal to RAW format and then run the data through the
programs Sandpaper (Vivid, MTV, Rayshade) or raw2pov (POV-Ray).
POV-Ray users! Since POV-Ray 2.0 has now been released to the public the
default output format has been changed to POV-Ray 2.0. If you're still
using POV-Ray 1.0 you can still generate 1.0 compatible files by using
the -op1 switch.
Operation:
Usage: frgen infile[.fr] [outfile] [options]
Options (yikes!)
-sxnnn Scale noise in x direction by nnn (0.0 - 1.0)
-synnn ' ' ' y ' ' ' ' '
-sznnn ' ' ' z ' ' ' ' '
-snnn Scale noise in x, y, and z directions by nnn
-bxnnn Bias noise in x direction by nnn (-1.0 - 1.0)
-bynnn ' ' ' y ' ' ' ' '
-bznnn ' ' ' z ' ' ' ' '
-bnnn Bias noise in x, y, and z directions by nnn
-fxnnn Set noise falloff factor in x direction to nnn (0.0 - 1.0)
-fynnn ' ' ' ' ' y ' ' ' ' '
-fznnn ' ' ' ' ' z ' ' ' ' '
-fnnn Set noise falloff factor in x, y, and z directions to nnn
-vxnnn Set view_point x coord to nnn
-vynnn ' ' y ' ' '
-vznnn ' ' z ' ' '
-lxnnn Set look_at x coord to nnn
-lynnn ' ' y ' ' '
-lznnn ' ' z ' ' '
-ennn Use nnn as seed for random number generator
-rnnn Maximum recursion depth of nnn
-d Preview generated fractal on screen
-x Exchange Y and Z coordinates on output
-op Output to POV-Ray 2.0 format (default)
-op1 Output to POV-Ray 1.0 format
-ov Output to Vivid format
-or Output to RAW triangle format
-on Null output. For quick preview.
Examples:
// Generate a mountain with display preview and output to POV-Ray 2.0
frgen mountain -d
// Generate some rolling hills with preview and output to Vivid
frgen hills -d -ov
// Generate a mountain with preview only (no output)
frgen mountain -d -on
// Generate a flatten out rocky terrain (no upward bias) with RAW output
frgen mountain -d -or -by0.0
// Generate a smooth valley (negative upward bias) with RAW output
frgen hills -d -or -by-0.5
infile[.fr] This is the file which contains the basic specifications
for the fractal. The first non-comment line of this file
is a list of default options for this fractal (comment
lines begin with a semi-colon). This line must be
present. The rest of the file contains a list of
coordinates for the triangles making up the base from
which the fractal grows. The coords of the triangles are
specified one per line in the following format:
ax ay az bx by bz cx cy cz [fix_ab fix_bc fix_ca]
The numbers ax, ay, etc. are the x,y,z coordinates of the
three vertices of the triangles. The three optional
numbers fix_ab, fix_bc, and fix_ca can be either 1 or 0
and specify whether that edge of the triangle is forced
to stay within the plane of the triangle or allowed to
move freely (1 = fixed, 0 = free). The most common use
for 'fixed' edges is to force the outer edges of a
mountain base to stay on the ground. If not specified,
edges are assumed to be free.
e.g.
; The default options are on the following line
-sx0.1 -sy0.2 -sz0.1 -by0.5 -r4 -vx10 -vy5 -vz-10
; Two triangles in the x-z plane making up the base
; of a mountain
+10.0 0.0 0.0 0.0 0.0 +10.0 -10.0 0.0 0.0 1 1 0
-10.0 0.0 0.0 0.0 0.0 -10.0 +10.0 0.0 0.0 1 1 0
Several sample input files are included:
box.fr - A simple box.
diamond.fr - A diamond shape.
hills.fr - Some rolling hills.
mountain.fr - Square based mountain.
plain.fr - A rolling plain.
sphere.fr - A fractal rock or asteroid.
outfile[.ext] Output file to be created. The extension added will
depend on the output format specified.
-sx -sy -sz These three numbers specify the magnitude of the noise
that will be used to perturb the triangles. Setting a
scaling factor of 0.0 (-sx0 -sy0 -sz0) will generate a
fractal that is unchanged from the starting shape while
a scaling factor of 1.0 (-sx1.0 -sy1.0 -sz1.0) will
create extremely distorted shapes. Values in the range
0.05 to 0.25 usually work well. All three numbers can be
set to the same value by using -s. Default values are
-sx0.1 -sy0.1 -sz0.1
-bx -by -bz These numbers specify the amount by which the noise is
biased in the corresponding x,y,z direction. A positive
value will cause the noise to tend to move in the
positive direction of the axis while a negative value
will tend to move it in the opposite direction. e.g. If
start with a triangle in the x-z plane, a setting of
-bx0.0 -by0.5 -bz0.0 will cause the fractal to tend to
bulge upward creating a mountain-like shape. All three
numbers can be set to the same value by using -b. Default
values are -bx0.0 -by0.0 -bz0.0
-fx -fy -fz These numbers specify the rate at which the perturbing
noise falls off as the subdivision continues. Values
slightly less than 1.0 (e.g. 0.8) will generate a surface
with a slightly weathered appearance. All three numbers can
be set to the same value by using -f. Default values are
-fx1.0 -fy1.0 -fz1.0
-vx -vy -vz The x, y, and z coordinates of the viewpoint. Used for
screen preview only.
-lx -ly -lz The x, y, and z coordinates of the point you are looking
at. Used for screen preview only.
-e You can use this option if you want to manually specify
the seed used by the random number generator. This is
useful if you want to reproduce the same fractal more
than once but using different view points, numbers of
triangles, etc.
-r This specifies the number of times to sub-divide the
triangles. Be careful when setting this number as the
number of triangles generated will increase by a factor
of 4 every time it is increased by 1. Default is -r3
-d Turns the display preview on.
-x This option causes the Y and Z coordinates to be switched
when writing the output file. This is useful if your
rendering package uses the Z axis as vertical instead of
the Y axis.
-op Selects POV-Ray 2.0 output format (default).
-op1 Selects POV-Ray 1.0 output.
-ov Selects Vivid output format.
-or Selects raw triangle output format.
-on No output. If you're just experimenting and don't want to
generate a file just yet then this option will speed up the
display preview quite a bit.
Revision History:
Changes in v1.4
- null file output for quicker previews
- added POV-Ray 2.0 output.
- added noise falloff parameters
- outputs to separate main file and include file
- adds a camera and light source to the scene
Changes in v1.3
- modified for POV-Ray 1.0 and Vivid 2.0 output format.
Changes in v1.2
- replaced DKB output with POV-Ray output.
- added Vivid and raw triangle output formats.
Changes in v1.1
- you can now start the fractal generation from any arbitrarily
specified set of base triangles instead of the simple square base
which was used in v1.0. You can now generate fractal spheres, boxes,
specifically shaped mountain ranges, etc.
- the program will now create an efficient set of bounding shapes for
the huge number of triangles generated. Scenes generated with v1.1
will typically render 5 to 10 times faster than those generated with
v1.0
- the 3D projection is now much more accurate, plus you can specify the
view-point and look-at coordinates instead of just the viewing angle.
CompuServe: 70714,3113
YCCMR BBS: (708)358-5611