Primitive lists provide tessellated surface geometry in the form of triangles or quads which is close to the internal data layout in mental ray. The vertices of faces may be shared to form a mesh. Extra custom data can be attached per face.
There are two versions for the syntax of primitive lists, ascii or binary.
The ascii version syntax is as follows:
trilist vertex nlines lineformat triangle ntriangles nborder [ vertex lines ] [ vertex reference indices ] [[ vertex reference indices for border triangles ]] end trilist
The vertex
statement provides:
p
n
d
d2
b
[ count
]m
[ count
]t
dim [
dim ... ]u
dim [
dim ... ]The vertex lines contains a list of entries each defining a vertex completely. The scalars need to be given in the format specified by lineformat. Here is an example:
vertex 184 p n t 2 3
The following example will define a line in this format:
[ 0.1 0.2 0.3 0 0 1 0.2 0.3 0.1 0.2 0.3] # position normal 2d texture 3d texture
The triangle
statement provides:
Here is a complete example for a primitive list:
trilist vertex 4 p n t 2 triangle 2 # pos normal tex1 (2-dimensional) [ 0 0 0 0 0 1 0. 0. # <-- line 0 1 0 0 0 0 1 1. 0. # 1 1 0 0 0 1 1. 1. # 0 1 0 0 0 1 0. 1. # <-- line 3 ] # 2 triangles (non-tagged) [ 0 1 2 2 3 0 ] end trilist
The binary version of syntax for primitive lists is as follows:
trilist vertex nlines lineformat triangle ntriangles nborder scalar ` 32-bit float data: vertex lines ` integer ` 32-bit integer data: triangle indices ` integer ` 32-bit integer data: triangle material tags ` # optional: border section integer ` 32-bit integer data: triangle indices ` integer ` 32-bit integer data: triangle material tags ` end trilist
Each material in the list corresponds to exactly one triangle. For non-tagged objects the triangle section is specified similar to the ascii version.
The 32-bit data is defined as a stream of network byte-order 32-bit words, interpreted either as scalars or integers.
Copyright © 1986-2010 by mental images GmbH