Next: BBOX, Previous: QUAD, Up: Object File Formats
The conventional suffix for a MESH
file is .mesh.
The file syntax is
[U][C][N][Z][4][u][v][n]MESH # Key word [Ndim] # Space dimension, present only if nMESH Nu Nv # Mesh grid dimensions # Nu*Nv vertices, in format specified # by initial key word vertex(u=0,v=0) vertex(1,0) ... vertex(Nu-1,0) vertex(0,1) ... vertex(Nu-1,1) ... vertex(0,Nv-1) ... vertex(Nu-1,Nv-1)
The key word is [U][C][N][Z][4][u][v][n]MESH
.
The optional prefix characters mean:
S
and T
texture
parameters for that vertex; the third should be specified as zero.
Z
and
4
cannot both be present.
Note that the order of prefix characters is significant; a colored,
u-wrapped mesh is a CuMESH
not a uCMESH
.
Following the mesh header are integers Nu and Nv, the dimensions of the mesh.
Then follow Nu*Nv vertices, each in the form given by the header. They appear in v-major order, i.e. if we name each vertex by (u,v) then the vertices appear in the order
(0,0) (1,0) (2,0) (3,0) ... (Nu-1,0) (0,1) (1,1) (2,1) (3,1) ... (Nu-1,1) ... (0,Nv-1) ... (Nu-1,Nv-1)
A MESH BINARY
format is accepted; See Binary format. The
values of Nu and Nv are 32-bit integers; all other values
are 32-bit floats.