Geometry (Donkey Kong Country Returns): Difference between revisions

>Aruki
mNo edit summary
>Aruki
Line 15: Line 15:
=== Vertex Coordinates ===
=== Vertex Coordinates ===


Vertex coords can be stored as either floats or signed shorts, depending whether flag 0x20 is set in the header. If they're shorts, then they need to be divided by 0x2000 to get the corresponding float value. Since they're signed numbers, that means that 0 to 0x7FFF correspond to the range 0.0-4.0, and 0x8000 to 0xFFFF correspond to the range -4.0-0.0.
In the CMDL format, vertex coords can be stored as either floats or signed shorts, depending whether flag 0x20 is set in the header. If they're shorts, then they need to be divided by 0x2000 to get the corresponding float value. Since they're signed numbers, that means that 0 to 0x7FFF correspond to the range 0.0-4.0, and 0x8000 to 0xFFFF correspond to the range -4.0-0.0. In the MREA format, these will always be stored as floats.


=== Normals ===
=== Normals ===
Anonymous user