bld2vrml

advertisement
=== Sam's bld2vrml Documentation ===
This program allows a user to describe three-dimensional drawings using a
simple procedural language that is translated into the "VRML" 3D graphics
format. These drawings can include lines, polygons, text, and simple
geometric primitives such as spheres, boxes, cylinders and cones. These
can be specified in terms of ordinary coordinates or in terms of any
rotated, scaled, or translated coordinate system (or any combination
thereof).
The commands are as follows:
(Square brackets denote optional parameters, along with their default
value)
(any input line whose first character is not a period)
Displays the line as visible text. The location and color of the
string should already be specified by the .cmov and .color commands.
.arrow x1 y1 z1 x2 y2 z2 [r1 = 0.1] [r2 = 4*r1] [rho = 0.75]
Draws an arrow from (x1, y1, z1) to (x2, y2, z2). An arrow consists
of a cylinder stretching from the initial point to an intermediary
junction, and a cone stretching from the junction to the final point. The
radius of the cylinder is 'r1'. The radius of the base of the cone is
'r2'. The percent of the total distance taken up by the cylinder is
'rho'.
.box x1 y1 z1 x2 y2 z2
Draws a 3D box with opposite corners at (x1, y1, z1) and (x2, y2,
z2). The color of the box is defined by the last .color command.
.cmov x y z
Sets the next character string to be displayed at (x, y, z)
.color name
Sets the color of subsequent text, line segments, and geometric
primitives. "Name" can be one of the following recognized color names:
white, green, cyan, blue, magenta, red, yellow, black, grey/gray.
Alternately, it can be an integer (between 0 and 65 inclusive) which
references the old BILD color wheel.
.color r g b
Sets the color of subsequent text, line segments, and geometric
primitives to be the RGB color with red component 'r', green component
'g', and blue component 'b'. Each value should be between zero and one
inclusive; zero indicates a total lack of a base color, and one indicates
a high amount of it.
.cone x1 y1 z1 x2 y2 z2 r [open]
Draws a 3D cone with a basis of radius 'r' centered at (x1, y1, z1)
and a tip at (x2, y2, z2). If the keyword 'open' is present at the end of
the line, the base of the cone will be invisible. The color of the cone
is defined by the last .color command.
.cylinder x1 y1 z1 x2 y2 z2 r [open]
Draws a 3D cylinder with a radius of 'r' and bases centered at (x1,
y1, z1) and (x2, y2, z2). If the keyword 'open' is present at the end of
the line, the bases of the cylinder will be invisible. The color of the
cylinder is defined by the last .color command.
.d x y z
.draw x y z
Add another vertex to the current set of line segments. A line will
be drawn from the previous vertex to this vertex at (x, y, z). There
should already have been a .m command prior to this command. The color of
the vertex is defined by the last .color command.
.dot x y z
.dotat x y z
Draw a dot at (x, y, z). The coordinate is treated as a vertex if
.d, .mr, or .dr commands follow. The color of the dot is defined by the
last .color command.
.dr dx dy dz
.drawrel dx dy dz
Add another vertex to the current set of line segments. A line will
be drawn from the previous vertex at (x, y, z) to this vertex at (x + dx,
y + dy, z + dz). The color of the vertex is defined by the last .color
command.
.font fontname size [style = 'plain']
Define the font that will be used when displaying subsequent text.
'Fontname' is the name of the type face (Serif, Sans Serif, or
Typewriter). Size is the height of each line of horizontal text. Style
can be one of the following: plain, bold, italic, bold italic.
.m x y z
.move x y z
Start a new set of line segments whose first vertex is at (x, y,
z). The color of the vertex is defined by the last .color command.
.marker x y z
Draw a small cubic marker at (x, y, z). As with .dot, the
coordinate is treated as a vertex if .d, .mr, or .dr commands follow. The
color of the marker is defined by the last .color command.
.mr dx dy dz
.moverel dx dy dz
Start a new set of line segments whose first vertex is at (x + dz,
y + dy, z + dz), where (x, y, z) is the coordinate of the last vertex
defined. The color of the vertex is defined by the last .color command.
.polygon x1 y1 z1 x2 y2 z2 ... xN yN zN
Draws a flat polygon with vertices at (x1, y1, z1), (x2, y2, z2),
..., (xN, yN, zN). The color of the polygon is defined by the last .color
command.
.pop
Discard the most recent transformation (rotation, scaling, or
translation) from the transformation stack.
.rot angle axis
.rotate angle axis
Rotates all subsequent coordinates (both for character strings and
vertices) by the given angle (specified in degrees) about the given axis
(either x, y, or z). This transformation is added to the top of the
transformation stack.
.scale xscale [yscale = xscale] [zscale = xscale]
Scale all subsequent coordinates (both for character strings and
vertices) by the given amount. Each component of the Cartesian coordinate
is scaled by the corresponding scale factor. This transformation is added
to the top of the transformation stack.
.sphere x y z r
Draws a 3D sphere centered at (x, y, z) with a radius 'r'. The
color of the sphere is defined by the last .color command.
.tran dx dy dz
.translate dx dy dz
Translate all subsequent coordinates (both for character strings
and vertices) by the specified amount. This transformation is added to
the top of the transformation stack.
.v x1 y1 z1 x2 y2 z2
.vector x1 y1 z1 x2 y2 z2
Draw a line segment from (x1, y1, z1) to (x2, y2, z2). This command
is a shorthand for
.m x1 y1 z1
.d x2 y2 z2
Download