3D model format: Difference between revisions
Created page with " tores 3D models, more investigation needed Thanks to Martin for initial format reversing. * Magic - <code>'PMD V1.83'</code> ** some files use version 1.82 instead, but th..." |
No edit summary |
||
Line 5: | Line 5: | ||
Thanks to Martin for initial format reversing. | Thanks to Martin for initial format reversing. | ||
* Magic - <code> | * Magic - <code>PMD V1.83</code> | ||
** some files use version 1.82 instead, but they aren't used by the game, the engine won't recognise anything other than 1.83 | ** some files use version 1.82 instead, but they aren't used by the game, the engine won't recognise anything other than 1.83 | ||
** There is one unused mention of "PMD V1.71" in the game binary | ** There is one unused mention of "PMD V1.71" in the game binary |
Revision as of 16:52, 26 December 2020
tores 3D models, more investigation needed
Thanks to Martin for initial format reversing.
- Magic -
PMD V1.83
- some files use version 1.82 instead, but they aren't used by the game, the engine won't recognise anything other than 1.83
- There is one unused mention of "PMD V1.71" in the game binary
Offset | Size | Description |
---|---|---|
0x0 | 0x18? | Magic - "PMD V1.83" |
0x18 | 0x4 | Type - 0 = shadow & skybox; 1 = track; 2 = car |
0x1C | 0x4 | Zeroes? |
0x20 | 0x94? | offsetsTable? array of 37 ints, might need to add constant 0x148 for elements 0-12 |
0xB4 | 0x94? | Sizes of data chunks ,array of 37 ints |
offsets1Table
- Looks like indexes 12,
13, 19, 34, and 35are always set to 0 in all known models 14-33 (minus 19 of course) is only set if the type is set to track (1)- I was off by 3 bytes, need to redo that part
You have to add 0x148 to each value to get proper pointers (works with elements 0-12, later ones will probably need different bias)
All blocks (or at least 0-11) are 32-bytes aligned, 12 is aligned so that the next block is 32-bit aligned
id | offset | Description |
---|---|---|
0 | 0x20 | |
1 | 0x24 | according to martinz it holds polygons data |
2 | 0x28 | according to martinz it holds uv texture data |
3 | 0x2c | according to martinz it holds vertex data |
4 | 0x30 | Mesh data? Always points to 0x1E, according to martinz it holds faces data0 |
5 | 0x34 | Textures names |
6 | 0x38 | Offsets to texture names, absolute addresses in file |
7 | 0x3c | Each element is 16B long, ?, ?, float, float |
8 | 0x40 | Holds IDs of elements in 7 |
9 | 0x44 | according to martinz it holds surface transforms data |
10 | 0x48 | according to martinz it holds surfaces data |
11 | 0x4c | Offset is 0x160, size 0x68 |
12 | 0x50 | Offset is 0x0; the size is non-zero, for shadow it's 1, with one 00 byte
|
13 | 0x54 | |
14 | 0x58 | |
15 | 0x5c | |
16 | 0x60 | |
17 | 0x64 | |
18 | 0x68 | |
19 | 0x6c | |
20 | 0x70 | |
21 | 0x74 | |
22 | 0x78 | |
23 | 0x7c | |
24 | 0x80 | |
25 | 0x84 | |
26 | 0x88 | |
27 | 0x8c | |
28 | 0x90 | |
29 | 0x94 | |
30 | 0x98 | |
31 | 0x9c | |
32 | 0xa0 | |
33 | 0xa4 | |
34 | 0xa8 | |
35 | 0xac | |
36 | 0xb0 |