3DN

From Carnivores Wiki
Jump to: navigation, search

3DN is a slightly simplified version of the 3DF and CAR file formats from the Action Forms-developed Carnivores games, used in Carnivores: Dinosaur Hunter. Specifically, the 3DN files swap the order of faces and vertices, so that vertices are stored first, and the files store only the model; the texture, animations, and sounds are stored elsewhere. These files are located in \models.

Format[edit | edit source]

// for each vertex (16 bytes)
float
4
X coordinate
float
4
Y coordinate
float
4
Z coordinate
uint32
4
owner
bone to which vertex is attached
// for each face (52 bytes)
uint32
4
v1
vertex 1
uint32
4
v2
vertex 2
uint32
4
v3
vertex 3
int16
2
tax
v1 texture U coordinate
int16
2
tay
v1 texture V coordinate
int16
2
tbx
v2 texture U coordinate
int16
2
tby
v2 texture V coordinate
int16
2
tcx
v3 texture U coordinate
int16
2
tcy
v3 texture V coordinate
uint16
2
flags
always null?
uint16
2
DMask
appears to be unused by the games, possibly editor/tool-specific
uint32
4
Distant
index to previous (parent) face
uint32
4
group
appears to be unused by the games, possibly editor/tool-specific
uint32
4
reserv[0]
0x00
unused; reserved for future use
uint32
4
reserv[1]
0x00
unused; reserved for future use
uint32
4
reserv[2]
0x00
unused; reserved for future use
// for each bone (48 bytes)
char
32
name
float
4
X coordinate
float
4
Y coordinate
float
4
Z coordinate
int16
2
index to the parent bone, -1 if there is no parent
uint16
2
whether the bone is hidden in Designer 2; has no effect in-game

Notes[edit | edit source]

  • The owner field in the vertex block is treated as a uint32 by the mobile games, instead of two separate uint16 fields as the PC games and editors did. There are no models with any non-null values in the second field, and no plans for editors to export to 3DN, so this is not a problem.
  • The texture UV coordinates were reordered from UUUVVV to UVUVUV (pairs of UV) by Tatem because the latter ordering is more convenient for modern hardware to handle. However, unlike typical modern implementations, which use normalized scalar values, 3DN files (and their CAR and 3DF predecessors) use pixel values for these fields.