Nomad 3D Model Format
The Nomad 3D Model Format is a binary file format that uses the file extension .BIN. These files can be found packed into the DAT archives used by Nomad, although they do not have a unique file extension even within the game; other files such as fonts and some data tables share the .BIN extension.
The 3D models are rendered untextured, and with flat shading. Each polygon face is assigned one of eight base colors, and up to eight tints/shades of each base color are used during rendering for a maximum of 64 colors on screen for 3D model rendering. Other game elements (such as sprites and other raster images) make use of different regions of the VGA palette.
The .BIN format was reverse engineered by cmb.
|Total number of polygons used in the model
|Array of polygon definitions; see POLYRECORD description below. Array size is pCount.
|Total number of vertices used in the model
|Array of vertex definitions; see VERTRECORD description below. Array size is vCount.
This is a struct of variable size, but it will be a minimum of 18 bytes (corresponding to the minimum vertex count of three.) This struct is two bytes larger for each additional vertex used by this polygon.
|Possibly an X coordinate of a direction vector?
|Possibly a Y coordinate of a direction vector?
|Possibly a Z coordinate of a direction vector?
|7-bit count of the number of vertices used by this polygon (stored in the lower 7 bits). The high bit is also sometimes set, but its purpose is unknown.
|Color for this polygon surface. This will be an index 00 through 07, which happens to match up to the first eight colors of the EGA palette. In reality, each of the these base colors will be one of eight shades when it is rendered on screen (as the 3D engine selects the appropriate one for highlights/shadows.) The 64 total colors that are used for drawing 3D models to the screen are provided by the palette SHIP.PAL.
|Array of 16-bit words, each one a 0-based index into the VERTRECORD structure that follows in the file. Array size is vCount.
|3D X coordinate
|3D Y coordinate
|3D Z coordinate