Geom Format

The "geom" format contains low level geometric primitives, points, lines,
facets, etc.
The "geom" file consists of a number of lines of printable ascii
characters, the first string in each line is the primitive ID. The rest
of the line (or lines) contain the data that is different for each
primitive. The arguments on each line are separated by any "white"
space (fscanf() is my parser).
After the last of the required arguments the rest of the
current line is considered a comment.
At the time of writing the primitives ID's and their required
arguments are a follows.

ID

Description

Arguments

Comments

#

Comment

Comments must start with a '#' in the first columns, they extend to
the end of the line.

s

Sphere

center(x,y,z),
radius,
colour(r,g,b)

Spheres should be used sparingly unless the rendering engine explicitly
supports them. For example, OpenGL does not and so each sphere becomes
a large number of polygons.

The text is drawn from a start position, along the right vector,
and in the plane of the right-up vector. The size is determined by
the right and up vector lengths.

p

Point

vertex(x,y,z),
colour(r,g,b)

P

Thick Point

vertex(x,y,z),
colour(r,g,b),
size

The size is in pixel coordinates, not world coordinates.

i

Illumination
(Point light source)

vertex(x,y,z),
colour(r,g,b)

There may be limitations on the number of light sources allowed,
for example, a maximum of 8 for OpenGL based systems.

l

Line

vertex1(x,y,z),
vertex2(x,y,z),
colour(r,g,b)

L

Thick Line

vertex1(x,y,z),
vertex2(x,y,z),
colour(r,g,b),
width

lc

Coolour Line

vertex1(x,y,z),
vertex2(x,y,z),
colour1(r,g,b)
colour2(r,g,b)

Colour at each end of the line, blended along the line.

f3

3 vertex facet

vertices[3],
colour(r,g,b)

The normal for each vertex is created from the cross product of the
three given vertices.

f3n

3 vertex facet
With normals

vertices[3],
normals[3],
colour(r,g,b)

f3c

3 vertex facet
With and colours

vertices[3],
colour[3]

f3nc

3 vertex facet
With normals and colours

vertices[3],
normals[3],
colour[3]

Each vertex has a normal and colour, this is the general primitive for
representing "smooth" objects.

f4

4 vertex facet

vertices[4],
colour(r,g,b)

The normal for each vertex is calculated from the cross product of the
first 3 vertices. Note that the vertices need not be coplanar but the
effects that might occur in such circumstances is undefined. Non planar
4 vertex facets are not recommended.

f4n

4 vertex facet
With normals

vertices[4],
normals[4],
colour(r,g,b)

f4c

4 vertex facet
With colours

vertices[4],
colour[4]

f4nc

4 vertex facet
With normals and colours

vertices[4],
normals[4],
colour[4]

This is the most general 4 vertex facet for representing smooth objects.

f4t

4 vertex facet
With texture

vertices[4],
colour,
texturefilename (tga),
scale,
transparency [o,t]

The colour is only used when the object is displayed in a draft or
non texture mode (or if the viewer doesn't support texture).
The texture scale is between 0 and 1.
1 is for a clamped textures over the whole plane, otherwise the texture
will be scaled and tiled over the polygon.
The last argument is a flag for transparent or opaque in which case the
colour is used internally to create an opaque mask.