Code: Select all
0000:0003 byte[4] always 33 44 50 46 "3DPF"
0004:0005 word always 4 so far (major version?)
0006:0007 word always 1 so far (minor version?)
0008:000B byte[4] always 33 44 4D 44 "3DMD"
000C:000F dword number of INST blocks
note: (0,0,0) appears to be track-level under center of loco
note: 1 unit is roughly 1 foot
0010:0013 float relative X (note: +X is toward left side of loco)
0014:0017 float relative Y (note: +Y is toward rear of loco?)
0018:001B float relative Z (note: +Z is toward top of loco)
001C:???? INST[INST block count]
An INST is a full representation of the model. Successive INST
blocks have lower polygon counts, possibly representing a view of
the model at a greater distance.
0000:0003 byte[4] always 49 4E 53 54 "INST"
0004:0007 dword vertex count
0008:000B dword triangle count
000C:???? Vertex[vertex count]
????:???? Triangle[triangle count]
A Vertex is simply a set of 3D floating-point coordinates:
0000:0003 float X
0004:0007 float Y
0008:000B float Z
A Triangle contains vertex indices, normals, texture UV coordinates,
and what I think is a material or texture index:
0000:000B dword[3] vertex indices
000C:002F float[3][3] normals for each vertex
0030:0047 float[3][2] texture UV coordinates for each vertex
0048:004B dword material index? (usually 0)
Somewhat disappointingly, there is no motion data in this file. I think the game may hardcode motions for objects with particular filenames:
_Light<n>
_Piston<n>
_ConnectingRod<n>
_CouplingBar<n>
_Drivewheel<n>
_Boggie<n> [sic]
_Bogie<n>
_Truck<n>
_Body
_LengthPoint
_ServicePoint
_TrackPoint
For buildings, animations appear to be done by flipping between _Anim<n> models.
Edit 2007/04/01: fixed INST definition