Meshview 1.2 File Formats.

Note: This document partially uses OOGL file format documentation distributed with Geomview.

The Meshview 1.2 supports MESH, OFF, LIST, FRAMES, DOT, and LINE formats.

MESH, OFF and LIST are very similar to the OOGL file formats. The OOGL formats are not fully implemented (no support for files with more than 4 dimensions), but several features are added.

FRAMES, DOT and LINE are specific to Meshview. FRAMES format is used for key frame animation, DOT and LINE are used to display dots and lines respectively.

Syntax

Keywords.

Keywords are case sensitive. Some have optional prefix and suffix letters indicating the presence of color or other data; in this case the order of prefixes and suffixes is significant,

File Names.

Meshview uses the file suffix to guess the file type. If the suffix is unrecognized, or if no suffix is available, all known types of objects are tried in turn until one accepts the data as valid.

Vertices.

All data for a vertex is grouped together.

The syntax is

`x y z' 
       (3-D floating-point vertex coordinates) or 
`x y z w' 
       (4-D floating-point vertex coordinates) 

optionally followed by 

`nx ny nz' 
       (normalized 3-D surface-normal if present) 
       Note: specified normals are not used in Meshview. They are 
       recalculated for each vertex.

optionally followed by 

`r g b a' 
    (4-component floating-point front side color if present, 
    each component in range 0..1. The a (alpha) component 
    represents opacity: 0 transparent, 1 opaque.) 

optionally followed by 

`r g b a' 
    (4-component floating-point back side color if present

optionally followed by 

`s t' 
    or 
`s t u' 
   (two or three texture-coordinate values). 

Values are separated by white space. Line breaks are immaterial.

Comments.

Comments begin with # and continue to the end of the line; they're allowed everywhere a newline is.

Object File Formats

MESH: rectangularly-connected mesh

The conventional suffix for a MESH file is `.mesh'. `.3mesh', `.meshc', and `.4mesh' are also supported.

The file syntax is

[U][C][C][N][Z][3][4][u][v][n]MESH[C][C] # key word 
[front.color] # color of the object (front side), present only if MESHC 
[back.color]  # color of the object (back side), present only if MESHCC 
[Ndim] # Space dimension, present only if nMESH. (Unsupported in Meshview.) 
Nu Nv  # Mesh grid dimensions 

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][C][N][Z][3][4][u][v][n]MESH [C][C]

The optional prefix characters mean:

The optional postfix characters mean:

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 RGBA colors of the object (if [C] postfix are specified) and 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)

OFF Files

The conventional suffix for OFF files is `.off'. 3`.off' and `.4off' are also supported.

Syntax:

[ST][C][C][D][D][N][3][4][n]OFF[C][C] # Header keyword 
[front.color] # color of the object (front side), present only if OFFC 
[back.color]  # color of the object (back side), present only if OFFxsCC 
[Ndim]  # Space dimension, present only if nOFF (unsupported in Meshview)
NVertices NFaces NEdges # NEdges not used or checked but has to be present 

x[0] y[0] z[0]    # Vertices, possibly with normals, 
                  # colors, and/or texture coordinates, in that order, 
                  # if the prefixes N, C, C, ST 
                  # are present. 
                  # If 4OFF, each vertex has 4 components. 
... 

x[NVertices-1] y[NVertices-1] z[NVertices-1] 
                  # Faces, possibly with colors 
                  # if the prefixes D, D, are present. 
                  # Nv = # vertices on this face 
                  # v[0] ... v[Nv-1]: vertex indices 
                  # in range 0..NVertices-1 

Nv v[0] v[1] ... v[Nv-1] [color.front] [color.back]
... 

The optional prefix characters mean:

The optional postfix characters mean:

Note that the order of prefix characters is significant.

OFF files (name for "object file format") represent collections of planar polygons with possibly shared vertices, a convenient way to describe polyhedra. The polygons may be concave but there's no provision for polygons containing holes.

An OFF file must begin with the keyword OFF.

Following the OFF header are RGBA colors of the object (if [C] postfixes are specified) and three ASCII integers : NVertices, NFaces, and NEdges. These are the number of vertices, faces, and edges, respectively. Meshview does not use nor check NEdges; it needn't be correct but must be present.

The vertex coordinates follow: (dimension * Nvertices) floating-point values. They're implicitly numbered 0 through NVertices-1. Dimension is either 3 (default) or 4 (specified by the key character 4 directly before OFF in the keyword).

Following these are the face descriptions.

Each has the form:

N Vert1 Vert2 ... VertN [color.front] [color.back] 

Here N is the number of vertices on this face, and Vert1 through VertN are indices into the list of vertices (in the range 0..NVertices-1).

The optional colors are in RGBA representation and present only if [D] [D] prefixes are specified.

DOT: used to display dots

The conventional suffix for a DOT file is `.dot'.

The file syntax is

[S][C][3][4]DOT[C]    # key word 
[color]               # color of dots, present only if DOTC
[size]                # size of dots (points), present only if SDOT 
Ndots                 # number of dots

x[0] y[0] z[0] [w[0]] # Dots, possibly with colors 
                      # if the prefix C is present. 
... 
x[Ndots-1] y[Ndots-1] z[Ndots-1] [w[Ndots-1]] 

The optional prefix characters mean:

The optional postfix characters mean:

Note that the order of prefix characters is significant.

Following the DOT header are RGBA color for all dots (if [C] postfix is present), size for all dots (if [S] prefix is present) and integer Ndots, the number of dots in object.

The dot coordinates follow: (dimension * Nvertices) floating-point values. They're implicitly numbered 0 through Ndots-1. Dimension is either 3 (default) or 4 (specified by the key character 4 directly before DOT in the keyword).

LINE: used to display lines

The conventional suffix for a DOT file is `.line'.

The file syntax is

[S][C][3][4]LINE[C] # key word 
[color]             # color of lines, present only if DOTC 
[size]              # size of lines (points), present only if SDOT 
Nvertices           # number of vertices 
Nlines              # number of lines 

x[0] y[0] z[0] [w[0]] 
                    # Vertices, possibly with colors 
                    # if the prefix C is present.
... 

x[Nvertices-1] y[Nvertices-1] z[Nvertices-1] [w[Nvertices-1]]  
                    # Lines 
                    # v[0] ... v[Nv-1]: vertex indices 
                    # in range 0..NVertices-1 

v[0] v[1]
... 

The optional prefix characters mean:

The optional postfix characters mean:

Note that the order of prefix characters is significant.

Following the LINE header are RGBA color for all verticess (if [C] postfix is present), size for all lines (if [S] prefix is present) and 2 integers: Nvertices (the number of vertices in the object), and Nlines (the number of lines in the object).

The vertix coordinates follow: (dimension * Nvertices) floating-point values. They're implicitly numbered 0 through NVertices-1. dimension is either 3 (default) or 4 (specified by the key character 4 directly before DOT in the keyword).

Following these are the line descriptions.

Each has the form:

Vert1 Vert2 

Vert1 through Vert2 are indices into the list of vertices (in the range 0..NVertices-1).

LIST Files

The conventional suffix for a LIST file is `.list'.

List of objects supported by Meshview.

Syntax:

LIST     # keyword

object 
object
... 

FRAMES Files

The conventional suffix for a FRAMES file is `.frm'.

A list of key frames.

Syntax:

FRAMES  # keyword
Nframes # number of frames 

frame 
frame 
... 

Frame can be any kind of object supported by Meshview, except LISTs including other LISTs and FRAMES itself. All frames should correspond to the same object. (E.g. they should have the same format, same number of vertices etc.).

FRAMES format is used to display key frame animation. Meshview interpolates between vertex and texture coordinates in adjacent frames.


Comments to: kishkov@cs.indana.edu
Created: Jul 21 1998 .