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 |
Group A (Material) Count |
0x0C |
4 |
Group A (Material) Offset |
0x10 |
4 |
Group B (Bone) Count |
0x14 |
4 |
Group B (Bone) Offset |
0x18 |
4 |
Group C (Object) Count |
0x1C |
4 |
Group C (Object) Offset |
Group A (Material) table : 0x1C bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset to string |
0x04 |
4 |
Offset to string |
0x08 |
4 |
Offset to string |
0x0C |
4 |
Data A Count |
0x10 |
4 |
Data A Offset |
0x14 |
4 |
Unknown |
0x18 |
4 |
Unknown |
Data A : 0x10 bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset to string |
0x04 |
4 |
Data Type?0:RGBA(float32 * 4)1:value(float32 * 1)2:Offset to string(int32 * 1) |
0x08 |
4 |
Unknown |
0x0C |
4 |
Offset to Data.Data size depends on the value of 0x04. |
Group B (Bone) table : 0x5C bytes
The data of size 0x5C is repeated as many times as the number of bones, regardless of the number of Group B in the header.
Therefore, the number of bones is calculated by (GroupC Offset - GroupB Offset)/0x5c.
Offset |
Size |
Description (Contains a lot of speculation.) |
- |
- |
Transformation Matrix 1 (World transformation matrix?) |
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 (Bone Offset Matrix?) 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. However, the signs are reversed. |
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 string (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 |
Group C (Object) table : 0x28 bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset to string |
0x04 |
4 |
Data C Count |
0x08 |
4 |
Data C Offset |
0x0C |
4 |
Unknown |
0x10 |
4 |
Unknown |
0x14 |
4 |
Unknown |
0x18 |
4 |
Unknown |
0x1C |
4 |
Unknown |
0x20 |
4 |
Unknown |
0x24 |
4 |
Unknown |
Data C : 0x2C bytes
Offset |
Size |
Description |
0x00 |
4 |
Offset to string |
0x04 |
4 |
Unknown |
0x08 |
4 |
SubDataC1(Vertex layout info) Count |
0x0C |
4 |
SubDataC1(Vertex layout info) Offset |
0x10 |
4 |
SubDataC2(Vertex data) Count |
0x14 |
4 |
SubDataC2(Vertex data) Offset |
0x18 |
4 |
SubDataC2(Vertex data) Size |
0x1C |
4 |
Unknown |
0x20 |
4 |
SubDataC3(Indice data) Count |
0x24 |
4 |
SubDataC3(Indice data) Offset |
0x28 |
4 |
Unknown |
SubData C1 (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 GroupB
(*2)Assignment of weights that each bone affects.(The sum of the weights is 1.0)
SubData C2 (Vertex data) : Variable length
Offset |
Size |
Description |
Variable |
Variable |
Vertex data |
SubData C3 (Indice data) : 0x02 bytes
Offset |
Size |
Description |
0x00 |
2 |
Vertex index, it is an unsigned value |