La saga de Carnivores - Los archivos .3df

The Carnivores saga - The .3df files

Estructura de los archivos .3df:
Structure of the .3df files:

Estos archivos se encuentran en el subdirectorio HUNTDAT\AREAS tanto en Carnivores como en Carnivores 2 y Ice Age. Los archivos consisten en varios bloques, empezando por un bloque de cabecera que tiene 16 bytes de largo.
These files are located in the HUNTDAT\AREAS subfolder both in Carnivores and in Carnivores 2 and Ice Age. The files consist of several blocks, starting with a header block which is 16 bytes long.

El formato completo de los bloques de triángulos y puntos aún necesita determinarse.
The full format of the triangles and points blocks needs still to be determined.
Tipos de datos empleados:/Data types used:

La estructura de archivo parece ser una versión algo simplificada de la usada para los objetos al interior de los archivos .rsc. La única diferencia que he notado hasta ahora es que tiene una cabecera más corta, faltando los primeros 64 bytes (los cuales, incidentalmente, aún no he identificado adecuadamente).
The file structure seems to be a somewhat simplified version of the one used for the objects within the .rsc files. The only difference I've noticed so far is that it has a shorter header, lacking the first 64 bytes (which, incidentally, I haven't properly identified yet).

Bloque de cabecera/Header block:

long num_points (número de puntos/number of points)
long num_triang (número de triángulos/number of triangles)
long num_bones (número de huesos/number of bones)
long long_tex (longitud del bloque de textura/length of texture block)

Bloque de triángulos/Triangles block:

num_triang bloques de 64 bytes cada uno, como sigue:/num_triang blocks of 64 bytes each, as follows:
long Tn_Point1 (punto 1 triángulo #n/triangle #n point 1)
long Tn_Point2 (punto 2 triángulo #n/triangle #n point 2)
long Tn_Point3 (punto 3 triángulo #n/triangle #n point 3)
long Tn_CoordX1 (coordenada X punto 1 textura triángulo #n/triangle #n texture point 1 X coordinate)
long Tn_CoordX2 (coordenada X punto 2 textura triángulo #n/triangle #n texture point 2 X coordinate)
long Tn_CoordX3 (coordenada X punto 3 textura triángulo #n/triangle #n texture point 3 X coordinate)
long Tn_CoordY1 (coordenada Y punto 1 textura triángulo #n/triangle #n texture point 1 Y coordinate)
long Tn_CoordY2 (coordenada Y punto 2 textura triángulo #n/triangle #n texture point 2 Y coordinate)
long Tn_CoordY3 (coordenada Y punto 3 textura triángulo #n/triangle #n texture point 3 Y coordinate)
long Tn_U1 (desconocido/unknown)
long Tn_U2 (desconocido/unknown)
long Tn_Parent (índice al triángulo "padre", -1 si no tiene/index to the "parent" triangle, -1 if it hasn't)
long Tn_U3 (desconocido/unknown)
long Tn_U4 (desconocido/unknown)
long Tn_U5 (desconocido/unknown)
long Tn_U6 (desconocido/unknown)
... etc.

Sub-bloque de puntos/Points sub-block:

num_points bloques de 16 bytes c.u., como sigue:/num_points blocks of 16 bytes each, as follows:
single Pn_CoordX (coordenada X punto #n/point #n X coordinate)
single Pn_CoordY (coordenada Y punto #n/point #n Y coordinate)
single Pn_CoordZ (coordenada Z punto #n/point #n Z coordinate)
long Pn_bone (hueso al que va unido el punto #n/bone to which point #n is attached)
... etc.

Sub-bloque de huesos/Bones sub-block:

num_comp bloques de 48 bytes c.u., como sigue:/num_comp blocks of 48 bytes each, as follows:
byte bone1_name[32] (nombre hueso #1/bone #1 name)
single bone1_X (coordenada X del hueso #1/bone #1 X coordinate)
single bone1_Y (coordenada Y del hueso #1/bone #1 Y coordinate)
single bone1_Z (coordenada Z del hueso #1/bone #1 Z coordinate)
short bone1_parent (índice al hueso "padre", -1 si no tiene/index to the "parent" bone, -1 if it hasn't)
short bone1_unknown (desconocido, usualmente 0/unknown, usually 0)
byte bone2_name[32] (nombre hueso #2/bone #2 name)
single bone2_X (coordenada X del hueso #2/bone #2 X coordinate)
single bone2_Y (coordenada Y del hueso #2/bone #2 Y coordinate)
single bone2_Z (coordenada Z del hueso #2/bone #2 Z coordinate)
short bone2_parent (índice al hueso "padre", -1 si no tiene/index to the "parent" bone, -1 if it hasn't)
short bone2_unknown (desconocido, usualmente 0/unknown, usually 0)
... etc.

Sub-bloque de textura/Texture sub-block:

byte texture[long_tex] (datos de textura, codificados a 16 bits estilo TGA, siempre 256 pixels de ancho/texture data, 16-bit TGA-style encoding, always 256 pixels wide)