
Next: Rotamer library
Up: File Formats
Previous: PhiMap file (.phi) files
Externally defined objects may be specified in a file, whose format is
similar to a Raster3D input file, but which is slightly more powerful and
readable than r3d files. If the file name is given the extension
.spo, it may be used as a command line option to spock (e.g. spock
test.spo). Raster3D files may also be read as external objects, or the
program $SPOCK/bin/r3d2spo may be used to translate a Raster3D file
to a spock object file.
An object file is mostly free-format; white space (including carriage
returns) is ignored. The only exception to this is that object
definitions must each begin on a separate line, but they may extend over
several lines. Object names are case-insensitive. In the format
description below, ``.f'' indicates a floating point parameter, and ``.i''
indicates an integer. Coordinates are indicated by x, y, and z
parameters; radii by rad parameters and the color components by red, green
and blue, parameters. Note that unlike Raster3D, the color components are
not squared. Since unrecognized tokens are skipped, comments may on any
line where a new object record is acceptable, but comments should not
contain any of the keywords in all caps below.
The different object types and their associated parameters are:
- POINTSIZE value.f (sets the size for following points)
- POINT x.f y.f z.f rad.f red.f green.f blue.f (draws a point)
- STAR x.f y.f z.f rad.f red.f green.f blue.f (draws a star
(like non-bonded atoms at point)
- SPHERE x.f y.f z.f rad.f red.f green.f blue.f (draws a sphere)
- CYLINDER x1.f y1.f z1.f rad1.f x2.f y2.f z2.f rad2.f red.f
green.f blue.f (draws a cylinder with flat ends. if rad1 and rad2
are not the same, a cone is drawn)
- CAPPEDCYLINDER x1.f y1.f z1.f rad1.f x2.f y2.f z2.f rad2.f
red.f green.f blue.f (draws a cylinder with rounded ends. if rad1
and rad2 are not the same, a cone is drawn.)
- LINE x1.f y1.f z1.f x2.f y2.f z2.f red.f green.f blue.f
(draws a line segment)
- TRIANGLE x1.f y1.f z1.f x2.f y2.f z2.f z3.f y3.f z3.f red1.f
green1.f blue1.f red2.f green2.f blue2.f red3.f green3.f blue3.f
(Draws a triangle. Each vertex may have a different color.)
- NORMAL nx1.f ny1.f nz1.f nx2.f ny2.f nz2.f nz3.f ny3.f nz3.f
(Sets the normals for the next triangle at each vertex.
This is different from Raster3D, where normal records are for the
previous triangle.)
- MATERIAL Sets up a special material type which will remain
valid until the next ``END'' record. A material record must be
terminated by ``DONE'', and may contain any of the following:
- SPECULAR red.f blue.f green.f alpha.f (sets rgba specularity)
- AMBIENT red.f blue.f green.f alpha.f (sets rgba ambient
contribution)
- EMISSION red.f blue.f green.f alpha.f (sets rgba emission)
- SHININESS value.i (sets shininess property)
- OPACITY value.f (sets opacity)
- DONE (closes the material definition; required)
- PROJECTION You can specify the projection parameters to use
with this object if desired. Like material properties the
projection record needs to be closed with ``DONE''.
- ORTHO left.f right.f top.f bottom.f near.f far.f
(sets the orthographic projection. left, right, etc., should be
the extreme values of the coordinates in the file)
- TRANSLATION x.f y.f z.f (sets an additional translation to
be applied after the rotation is applied)
- ORIGIN x.f y.f z.f (the center of the coordinates/origin of
rotation)
- ROTATION (a 4x4 rotation matrix follows)
- DONE (terminates the projection record)
- END Ends use of the current material.
Anywhere it's valid to specify a new object
record, you may instead specify a file by starting the line with ``@'' and
the filename (no quotes). Objects will be read from the new file, and
then processing of the current file will be resumed where it left off.
This allows for re-use of some standard objects or materials. Files may
also be nested to a (theoretically) unlimited degree.
Here's an example objects file:
POINTSIZE 2
POINT .25 0 .25 1 0 0
POINT .25 .25 0 0 1 0
POINTSIZE 10
POINT .25 .25 .25 0 1 0
STAR 0 0 0 1 1 1
STAR -.12 0 -.02 1 .5 .5
MATERIAL
SHININESS 60.000000
SPECULAR 0.000000 0.000000 0.000000 1.0
OPACITY 0.250000
DONE
SPHERE
-0.4257 0.1267 0.1118 0.0268
0.0000 1.0000 0.0000
SPHERE
-0.0301 -0.0869 0.4006 0.0268
0.0000 1.0000 1.0000
MATERIAL
SHININESS 60.000000
SPECULAR 0.000000 0.000000 0.000000 1.0
OPACITY 1.000000
DONE
SPHERE
0.3287 0.1257 0.0664 0.0268
0.0625 0.0625 1.0000
TRIANGLE
-0.0670 0.3393 -0.2223
-0.4442 -0.3146 -0.1889
0.3101 -0.3155 -0.2344
1.0000 0.0000 0.0000
0.0000 1.0000 0.0000
0.0000 0.0000 1.0000
LINE
-0.0670 0.3393 -0.2223
-0.0301 -0.0869 0.4006
1.0000 0.0000 0.0000
Cylinder
0.3101 -0.3155 -0.2344 0.0142
-0.0301 -0.0869 0.4006 0.0000
1.0000 1.0000 0.0000
PROJECTION
ORTHO -0.5978 0.5978 -0.5978 0.5978 0.0000 1.1956 0.0000 1.1956
ORIGIN 0.0311 -0.0446 0.0184
TRANSLATION 0.0000 0.0000 -0.5978
ROTATION 1.0000 0.0000 0.0000 0.0000
0.0000 1.0000 0.0000 0.0000
0.0000 0.0000 1.0000 0.0000
0.0000 0.0000 0.0000 1.0000
DONE

Next: Rotamer library
Up: File Formats
Previous: PhiMap file (.phi) files
Jon Christopher
Tue Sep 14 16:44:48 CDT 1999