5,389
edits
mNo edit summary |
m (→Corpses: matrix) |
||
Line 70: | Line 70: | ||
*A space for notes (160 bytes) : often the name of the file the corpse was taken from when packing the array. | *A space for notes (160 bytes) : often the name of the file the corpse was taken from when packing the array. | ||
*A link to the [[OBD:ONCC|ONCC]] (model that should be used for the corpse) : that's 4 bytes as usual. | *A link to the [[OBD:ONCC|ONCC]] (model that should be used for the corpse) : that's 4 bytes as usual. | ||
*Then, 19 bones, each of them defined by absolute | *Then, 19 bones, each of them defined by absolute position and transformation matrix<br>Every bone is (3*3 + 3)*4 = 48 bytes, so that's 19*48 = 912 bytes. | ||
*Finally, an axis-aligned bounding box (2*3*4 = 24 bytes) | *Finally, an axis-aligned bounding box (2*3*4 = 24 bytes) | ||
The total size of a corpse is thus 1100 bytes. | The total size of a corpse is thus 1100 bytes. | ||
;What's in a bone?:The | ;What's in a bone? | ||
:three 3D vectors '''x''', '''y''' and '''z''', | :The transformation matrix and the offset. | ||
: | |||
:The transformation matrix can define rotation, stretching, mirroring etc, in the following way. | |||
: | :It can be seen as three 3D vectors '''x''', '''y''' and '''z''' (see table below). | ||
Reminder : the 2nd coordinate of '''R' | :If a bone mesh has a vertex at (x, y, z) in its native coordinates, | ||
::then the actual position of that vertex in the level will be '''R''' + x '''x''' + y '''y''' + z '''z''' | |||
:That's the transformation defined by the matrix and the offset '''R'''. | |||
Reminder : the 2nd coordinate of '''R''' is the height; same for '''x''', '''y''' and '''z'''. | |||
;Example:first corpse of '''00565-.CRSA''' in '''level3_Final.dat'''. | ;Example:first corpse of '''00565-.CRSA''' in '''level3_Final.dat'''. |