Jump to content

OBD:TRAM/raw0x34: Difference between revisions

no edit summary
m (fixing PNG link, may replace with hex table)
No edit summary
Line 184: Line 184:
|0x00C0
|0x00C0
|}
|}
An orientation consists of three angles, each of them a 2-byte integer (short). To get the angle in radians one needs to multiply the value with 9.587526e-5 (that is PI / 32767.5). Note that these angles cannot be used directly for interpolation, they must first be converted to quaternions.
An orientation consists of three angles, each of them stored 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).
:*To convert from degrees to the stored integer the value must be multiplied by 182.0416667 (that's 32767.5 / 180).
 
Note that these angles cannot be used directly for interpolation, they must first be converted to quaternions.


The example here is the '''SHINZOMidle1''' animation (10 frames long)
The example here is the '''SHINZOMidle1''' animation (10 frames long)
Line 345: Line 350:


A leg's orientation is quite intuitive : if you set everything to (0°, 0°, 0°) except the orientation of the thighs (both set to (0°, 0°, 180°)), you get "normal" legs. Arms are a bit more complicated.
A leg's orientation is quite intuitive : if you set everything to (0°, 0°, 0°) except the orientation of the thighs (both set to (0°, 0°, 180°)), you get "normal" legs. Arms are a bit more complicated.
More, later...
:Here is kinda "polished" formula how to get angle in degrees from binary data and vice versa.
:'''X''' is value from binary in decimal (converted)
:'''α''' is angle in degrees
:α= X*2,4/436,9
:X= α*436,9/2,4
:Receipt is easy. Get value from binary data and conver it into decimal. this number is '''X''', so use first formula to get angle. Maybe these formulas can be shorted even more, but I think this is both quite nice and accurate.
::[[User:Loser|Loser]] 21:13, 12 July 2007 (CEST)
:Can't see what's so un-nice about 8192/45 and 45/8192 or (duh) 65536/360 and 360/65536...
:For dequantization to radians, the engine uses 9.587526e-5= 2*PI/65535 as detailed [[OBD:TRAM/raw0x34#Compression_size_6|ABOVE]].
:(although in my opinion it's more consistent to use 9.587380e-5= 2*PI/65536 ... oh well)
::[[User:Geyser|geyser]] 04:37, 13 July 2007 (CEST)




708

edits