next up gif contents index
Next: Rotamer library Up: File Formats Previous: PhiMap file (.phi) files

 

External objects (.spo) file

  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:

 

File indirection.

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.

Example.

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 up gif contents index
Next: Rotamer library Up: File Formats Previous: PhiMap file (.phi) files

Jon Christopher
Tue Sep 14 16:44:48 CDT 1999