MODL
This page attempts to document the LucasArts MODL mesh format, file extension ".3do". Work is ongoing, so no guarantees are made regarding any information on this page.
Variants
The MODL format comes in two flavours: binary, and ASCII. The ASCII flavour is used in the Grim Fandango demo, and the binary one is used in the full version. It follows that the demo version contains ASCII-versions of models that appear in the full version. Such models should be approached with care, because it's not unlikely that corresponding models from the two versions contain slightly different data.
This document is concerned with the binary flavour of the mesh files.
TODO -- add more games that use MODL, if there are any; upload samples.
Conventions/Terminology
This document employs several terms and conventions for convenience. Most of these are concerned with data types, of course.
- float - IEEE floating point value
- vectorN - an N-dimensional array that consists of N floats
- All values are little-endian unless otherwise specified
- geoset - a collection of meshes
- string - character array padded with zeros (one or more) at the end
Layout
The MODL format, at the highest level, has the following layout:
header geoset(s) \mesh(es) \face(s) node(s) footer
That is, mesh primitives with no relational information is specified first through geosets, meshes, and faces. Relations between mesh primitives are represented through nodes, which are specified last.
Header
The header is formatted as follows.
"MODL" FOURCC |4 bytes number of materials used|4 bytes
This is followed by material name fields, one per material:
material name, string|32 bytes
...followed the rest of the header:
3d model name, string|32 bytes