Scene Section


Summary

Common Scene Item Properties

Filled
Outlined
Multicolor
Transparent
Normals

Scene Section Items

Point Item
Line Item
Triangle Item
Quadrilateral Item
Sphere Item
Spheroid Item


Common Scene Item Properties

Each different Scene Item follows the following pattern for arrangement:

unsigned char = object properties
float [3] = vertex position
. . .
float [<3 | 4>] = color of vertex or shape (may not be needed)
. . .
float [3] = normalized normal vector
. . .

All Scene Items share a common-format description byte. It is an unsigned char that describes what object properties to expect. The property byte is composed by oring the following:

Filled (SFILL tag)

Indicates that the object should be filled. *

Outlined (SOUTLINE tag)

Indicates that the object should be outlined. *

Multicolor (SMULTICOLOR tag)

Indicates that each vertex should be a different color, e.g., a triangle would have three sets of colors instead of one in the file. It is not possible to only specify colors for some of the vertices--all must be specified.

Transparent (STRANSPARENT tag)

Indicates that all defined colors will have an alpha channel, i.e., the RGBA color model is to be used instead of the RGB color model. This results in a float [4] being written for each color.

Normals (SNORMALS tag)

Indicates that normals are specified. Normally, normals are implicitly defined as being a vector orthogonal to the plane defined by the first three points of a closed shape; however, this allows for non-orthogonal normals to create smoother-looking scenes. Important: if normals are to be defined, make sure they are normalized, i.e., they are unit length. Also, normals must point away from the surface being lit, e.g., a sphere made from triangles would have all normal vectors pointing away from the center.

When defining closed shapes (triangles and quadrilaterals), corners must be defined in a counterclockwise fashion to the front. If normals are specified, then they must agree with the direction of the corners of the shape. For example, in a sphere made of triangles, looking at it from the outside, all visible triangles must be defined counterclockwise and all normals must be pointing towards the camera.

* the Filled and Outlined Properties can be used together to get interesting results. If neither is specified, then the shape is sent to the outline list, and no colors are needed in the file. If both are specified, then the shape is outlined (sent to the outline list), and it is also filled.

Since each shape is different, not all properties can be set the same, e.g., a point cannot be filled, multicolor, or have a normal. See each shape for more details.


Scene Section Items

Point Item (SPOINT tag)

This item draws a point. Points cannot be filled, they are always outlined, they cannot be multicolor, they can be transparent, and they cannot have normals.

Format:

unsigned char = common scene item properties
float [3] = vector 1
float [<3 | 4>] = color (may be using RGB or RGBA depending on properties)

Line Item (SLINE tag)

This item draws a line. Lines cannot be filled, they are always outlined, they can be multicolor, they can be transparent, and they cannot have normals.

Format:

unsigned char = common scene item properties
float [3] = vector 1
float [3] = vector 2
float [<3 | 4>] = color (may be using RGB or RGBA depending on properties)
(. . .) (if multicolor)

Triangle Item (STRIA tag)

This item draws a triangle. Triangles can be filled, they can be outlined, they can be multicolor, they can be transparent, and they can have normals.

Format:

unsigned char = common scene item properties
float [3] = vector 1
float [3] = vector 2
float [3] = vector 3
float [<3 | 4>] = color (may be using RGB or RGBA depending on properties)
(. . .
 . . .) (if multicolor)
(float [3][3] = normals) (if normals are selected)

Quadrilateral Item (SQUADRI tag)

This item draws a quadrilateral. Quadrilaterals can be filled, they can be outlined, they can be multicolor, they can be transparent, and they can have normals. Important: the quadrilateral corners must be coplanar when defined in order to render properly--if a non-flat quadrilateral is wanted, then two triangles should be used.

Format:

unsigned char = common scene item properties
float [3] = vector 1
float [3] = vector 2
float [3] = vector 3
float [3] = vector 4
float [<3 | 4>] = color (may be using RGB or RGBA depending on properties)
(. . .
 . . .
 . . .) (if multicolor)
(float [3][4] = normals) (if normals are selected)

Sphere Item (SSPHERE tag)

This item draws a sphere. Spheres can be filled, they can be outlined, they cannot be multicolor, they can be transparent, and they cannot have normals defined (normals are automatically created for a filled sphere).

Format:

unsigned char = common scene item properties
float [3] = vector 1 (the position of the center of the sphere)
float = radius
float [<3 | 4>] = color (may be using RGB or RGBA depending on properties)

Spheroid Item (SSPHOID tag)

This item draws a spheroid. Spheroids can be filled, they can be outlined, they cannot be multicolor, they can be transparent, and they cannot have normals defined (normals are automatically created for a filled spheroid).

Format:

unsigned char = common scene item properties
float [3] = vector 1 (the position of the center of the spheroid)
float [3] = size (the (x, y, z) dimensions before rotation)
float [4] = rotation (specified by (theta, x, y, z), where theta is the counterclockwise angle in degrees, which is to rotate about the vector (x, y, z). No rotation will occur if a zero angle or a null vector is passed)
float [<3 | 4>] = color (may be using RGB or RGBA depending on properties)