EDF3(EDF2017) DXM(model) Format - KCreator/Earth-Defence-Force-Documentation GitHub Wiki
This is the format for EDF2017 model data(It is in a file with extension dxb or dxm).
Considered to have a role similar to that of the MDB Format.
Each offset starts at the beginning of the table.
Header table : 0x20 bytes
Offset |
Size |
Description |
0x00 |
4 |
"DXM" header |
0x04 |
4 |
01 01 00 00 |
0x08 |
4 |
Material Count |
0x0C |
4 |
Material Offset |
0x10 |
4 |
Bone Count |
0x14 |
4 |
Bone Offset |
0x18 |
4 |
Object Count |
0x1C |
4 |
Object Offset |
Material table : 0x1C bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset to Material Name |
0x04 |
4 |
Offset to Shader Name |
0x08 |
4 |
Offset to Render Name |
0x0C |
4 |
Material Parameters Count |
0x10 |
4 |
Material Parameters Offset |
0x14 |
4 |
Unknown |
0x18 |
4 |
Unknown |
Material Parameters : 0x10 bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset to Material Parameter Name |
0x04 |
4 |
Data Type?0:value(float32 * 1)1:RGBA(float32 * 4)2:Offset to string(int32 * 1) |
0x08 |
4 |
Unknown |
0x0C |
4 |
Offset to Data.Data size depends on the value of 0x04. |
Bone table : 0x5C bytes
The data of size 0x5C is repeated as many times as the number of bones, regardless of Bone Count in the header.
Therefore, the number of bones is calculated by (Object Offset - Bone Offset)/0x5c.
Offset |
Size |
Description (Contains a lot of speculation.) |
- |
- |
Transformation Matrix 1 Bone coordinates (position, rotation). The coordinates are not relative to the parent bone, but relative to the zero point. |
0x00 |
4 |
position x |
0x04 |
4 |
position y |
0x08 |
4 |
position z |
0x0C |
4 |
Rotation angle relative to x-axis |
0x10 |
4 |
Rotation angle relative to y-axis |
0x14 |
4 |
Rotation angle relative to z-axis |
- |
- |
Transformation Matrix 2 In MDB, it was a matrix that returns the bone to the zero point, but in DXM, it is a matrix that returns the bone to the parent bone. |
0x18 |
4 |
position x |
0x1C |
4 |
position y |
0x20 |
4 |
position z |
0x24 |
4 |
Rotation angle relative to x-axis |
0x28 |
4 |
Rotation angle relative to y-axis |
0x2C |
4 |
Rotation angle relative to z-axis |
- |
- |
- |
0x30 |
4 |
contact position x |
0x34 |
4 |
contact position y |
0x38 |
4 |
contact position z |
0x3C |
4 |
float x |
0x40 |
4 |
float y |
0x44 |
4 |
float z |
0x48 |
4 |
unknown |
0x4C |
4 |
Offset to Bone name |
0x50 |
4 |
Number of Bone children |
0x54 |
4 |
Offset to Next Bone Data (which is a multiple of 0x5C) |
0x58 |
4 |
Bone ID used in BLENDINDICE |
Object table : 0x28 bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset to string |
0x04 |
4 |
Mesh Count |
0x08 |
4 |
Mesh Offset |
0x0C |
4 |
Unknown |
0x10 |
4 |
Unknown |
0x14 |
4 |
Unknown |
0x18 |
4 |
Unknown |
0x1C |
4 |
Unknown |
0x20 |
4 |
Unknown |
0x24 |
4 |
Unknown |
Mesh : 0x2C bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset to Material Name(I assume this specifies which Material to use.) |
0x04 |
4 |
Unknown |
0x08 |
4 |
Vertex layout info Count |
0x0C |
4 |
Vertex layout info Offset |
0x10 |
4 |
Vertex data Count |
0x14 |
4 |
Vertex data Offset |
0x18 |
4 |
Vertex data Size |
0x1C |
4 |
Unknown |
0x20 |
4 |
Indice data Count |
0x24 |
4 |
Indice data Offset |
0x28 |
4 |
Unknown |
Vertex layout info : 0x0C bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset in vertex data |
0x04 |
4 |
Type A (data length) |
0x08 |
4 |
Type B (vertex name?) |
Vertex types :
Type A |
data length |
Description |
Used as |
1 |
8byte |
float32 * 2 |
TEXCOORD |
2 |
12byte |
float32 * 3 |
POSITION,NORMAL,TANGENT |
3 |
16byte |
float32 * 4 |
BLENDWEIGHT |
5 |
4byte |
int8 * 4 |
BLENDINDICE |
Type B |
vertex name (Contains a lot of speculation.) |
0 |
POSITION |
1 |
NORMAL |
2 |
unused.(BINORMAL?) |
3 |
TANGENT |
4 |
TEXCOORD(DiffuseTexture) |
5 |
TEXCOORD(ParameterTexture) |
6 |
TEXCOORD(NormalTexture) |
7 |
TEXCOORD(HighlightTexture or CubeTexture) |
8 |
TEXCOORD(CubeTexture) |
9 |
unused. |
10 |
unused. |
11 |
unused. |
12 |
BLENDINDICE(*1) |
13 |
BLENDWEIGHT(*2) |
(*1)Indicates Bone ID that affects vertex.(Up to 4 bones?)
Note that Bone ID is not the one assigned in the order of appearance, but the 0x58 in Bone table
(*2)Assignment of weights that each bone affects.(The sum of the weights is 1.0)
Vertex data : Variable length
Offset |
Size |
Description |
Variable |
Variable |
Vertex data |
Indice data : 0x02 bytes
Offset |
Size |
Description |
0x00 |
2 |
Vertex index, it is an unsigned value |