Jump to content

OBD:TRAM/raw0x34: Difference between revisions

m
m (→‎Compression size 6: reformulating)
Line 184: Line 184:
|0x00C0
|0x00C0
|}
|}
An orientation consists of three angles, each of them stored as a 2-byte signed integer (short).  
An orientation consists of three angles, each of them stored in quantized form, as a 2-byte signed integer (short).  


:*To convert from the stored integer to degrees the value must be multiplied by 0.0054932 (that's 180 / 32767.5).
:*Oni converts from the stored integer to an angle through multiplication by 360°/65535 = '''0.00549324'''78828[...]
:*To convert from degrees to the stored integer the value must be multiplied by 182.0416667 (that's 32767.5 / 180).
:*Thus, when quantizing angles from a new animation, multiply the angles by 65535/360° = '''182.041'''6667[...]
(It would make more sense here to take the ratio with 65536 rather than 65535, but Oni indeed uses 65535.)


Note that these angles cannot be used directly for interpolation, they must first be converted to quaternions.
Note that these angles cannot be used directly for interpolation, they must first be converted to quaternions.