wiki:MindSeer_Model_Format

Version 2 (modified by trac, 12 years ago) (diff)

--

MindSeer Model Format

The MindSeer model format is based on the Geomview binary OFF format. The goals are (in order):

  1. Compatibilty -- it is designed to be 100% compatible with Geomview and programs that can read binary OFF files.
  2. Load speed.

The MindSeer internal data structure for the model consists of many chunks divided into rough cubes (the center of each face falls into the cube, so some vertices are outside of it) so that we can perform the necessary cutaway and dramatically improve picking performance. To most other programs, these divisions are arbitrary and do not impact anything of substance, so we do not want to explicitly divide the model in its saved form. To accomodate this, we signal the end of a chunk with a face that consists of a single point that has the value of the chunk number (if the chunk number is larger than the largest vertex index, simple loop to 0)

NOFF #MindSeer OFF(5)
nVert nFace nEdge 
#vert
3 0  2  3   # Chunk 0
3 2  3  4
3 3  4  7
3 4  7  1
3 7  1  6
1 1         # End of Chunk 0, start of Chunk 1
3 8  9  10
...
1 2        # End of Chunk 1, start of Chunk 2

You will also notice that this is stripped. However since we are encoding a set of strips as faces, the first 2 vertices of F[n] are the same as the last two F[n - 1]. By observing these, strips can be quickly rebuilt.

The first comment should contain the following string: "MindSeer OFF" followed by (chunk size in mm). So if the chunks are aligned into 5mm cubes the header would be "MindSeer OFF(5)"

Notes:

  • Normals are required
  • Chunk order is not specified.
  • All faces must be triangles.
  • Non Binary files should also work, but are not recommended.
  • Like all GeomView? binaries, the Byte Order is Big Endian (Java native byte order, network byte order and the byte order on some platforms).
  • If the data was stripped, it should be stored in order so that triangle strips can be reconstructed.
  • chunk size is required and must be correct. Incorrect chunk size results in unspecified results (but mostly bad)