<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to MAXFormat</title><link>https://sourceforge.net/p/miscopter/wiki/MAXFormat/</link><description>Recent changes to MAXFormat</description><atom:link href="https://sourceforge.net/p/miscopter/wiki/MAXFormat/feed" rel="self"/><language>en</language><lastBuildDate>Mon, 27 Jul 2015 17:31:33 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/miscopter/wiki/MAXFormat/feed" rel="self" type="application/rss+xml"/><item><title>MAXFormat modified by Anonymous</title><link>https://sourceforge.net/p/miscopter/wiki/MAXFormat/</link><description>&lt;div class="markdown_content"&gt;&lt;h1 id="introduction"&gt;Introduction&lt;/h1&gt;
&lt;p&gt;Geometry data for models (buildings, helicopters, ground objects, etc) appears to be stored in the three sim3d?.max files. Rough guess at a file format follows. &lt;/p&gt;
&lt;h1 id="details"&gt;Details&lt;/h1&gt;
&lt;p&gt;&lt;strong&gt;All integers are Intel Little-Endian unless otherwise specified&lt;/strong&gt;&lt;/p&gt;
&lt;div class="codehilite"&gt;&lt;pre&gt;Header:
'DIRC'
int32: total size of DIRCchunk, incl. first 8 bytes (aka total file size)
int32: number of subchunks (typically 2)
'CMAP'
int32: pointer to CMAP data start (typically 0x1C)
'GEOM'
int32: pointer to GEOM data start (typically 829)

'CMAP' ("color map" - aka PALETTE)
int32: size of CMAP block, incl. 8 bytes 'CMAP'int32 header (typically 801)
int32: number of subblocks (just 1 here)
'CMAP' (subblock: the real palette starts here)
785 bytes: palette data
. int32: ???
. 3 x 3 bytes: Transparent colors?  "Magic" fullbright colors?
. int32: (offset 57): pointer to palette start, in file (or DIRC), typically 61
. 768 bytes: palette data, RGB, 3x256 with 8 bytes per component (24bits per entry)

'GEOM': geometry data start (typically offsett 829)
int32: size of geom block, incl. first 8 bytes
int32: num subblocks
int32: num geom units (subblocks - 1)
int32: offset to start of name table
int32: offset to start of model data

(geom name table)
17 bytes: null-terminated geom name
int32: offset into mesh table
int32: Flags?  1 = object, 143 = filename (sim3d1, etc)
int32: always 0
int32: Number of VERTICES
int32: always 0
int32: always 0
int32: Number of FACES
int32: ?? Possibly something to do with Texturing?
int32: Always 0

Duplicate GEOM table follows.
9xint32 in a row, just copies of the int32 set above, except without Flags and with a prepended ID

(geom object table)
Offsets are stored in the first int32 in the name table

'OBJX': marks an Object.  Items in the Names table point here.
int32: size.  Incl. header. But bugged: must add 12 bytes.
int16: QQ Number of Vertices in Vertex-array Block
int16: num FACES
int32: always 0
int32: ???? maybe a scale factor, a unique ID or a CRC or something
int32: always 0
88 bytes: null-terminated, null-padded object name
12 bytes:  JUNK.  This is where the bug comes in, above: somebody at Maxis calculated sizeof(Name) wrong.

Vertex-array Block
3 * (QQ) int32: Vertex array.  X, Y, Z coords, as signed int32 one after another.  First vertex in the list is the Origin.

YYY 'FACE' blocks (see object defs)
'FACE'
int32: size, incl. header
byte: num vertices
12 bytes: ???
vertices * int16s: Reference into Vertex table, above
8 more bytes per vertex: ???
&lt;/pre&gt;&lt;/div&gt;
&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">Anonymous</dc:creator><pubDate>Mon, 27 Jul 2015 17:31:33 -0000</pubDate><guid>https://sourceforge.netba3caa2b11066f8b403b88aec93eca52c3119e05</guid></item></channel></rss>