OBD:OBAN: Difference between revisions

From OniGalore
Jump to navigation Jump to search
m (hex image link; Can we place the matrix stuff below the table and not in a cell?)
m (fixed transform matrix was wrong)
Line 48: Line 48:
{|border=1 cellspacing=0 style="white-space:nowrap"
{|border=1 cellspacing=0 style="white-space:nowrap"
|1.819999||0.0||0.0
|1.819999||0.0||0.0
|-
|0.0||1.819999||0.0
|-
|-
|0.0||0.0||1.819999
|0.0||0.0||1.819999
|-
|0.0||1.819999||0.0
|-
|-
|0.0||0.0||0.0
|0.0||0.0||0.0
Line 104: Line 104:
:The only transform that can't be handled by the quaternion+position is scaling/mirroring.
:The only transform that can't be handled by the quaternion+position is scaling/mirroring.
:Thus, the fixed transform is a scaling matrix most of the time (no rotation or translation).
:Thus, the fixed transform is a scaling matrix most of the time (no rotation or translation).
:In the above example, the fixed transform performs a scaling and also swaps Y and Z axes.
:In the above example, the fixed transform scales the van up by 1.82 (along all three axes).
;Quaternions
;Quaternions
:Those are used in Oni whenever interpolation of 3D rotation is involved (e.g., [[OBD_talk:TRAM/raw0x34#Quaternions|TRAM rotation]])
:Those are used in Oni whenever interpolation of 3D rotation is involved (e.g., [[OBD_talk:TRAM/raw0x34#Quaternions|TRAM rotation]])

Revision as of 16:34, 6 September 2007

ONI BINARY DATA
Mtrl << Other file types >> OBDC
OBAN : Object Animation
switch to XML:OBAN page
Overview @ Oni Stuff
OBD.png


Oban a.gif


Offset Type Raw Hex Value Description
0x00 res_id 01 86 00 00 134 00134-Blackvan_FB.OBAN
0x04 lev_id 01 00 00 06 3 level 3
0x08 blank[16] 00 00 00 00 0 blank filler
0x18 matrix
C2 F5 E8 3F AB D7 AA B3 EC 89 13 35
EC 89 13 35 ED 89 13 B4 C2 F5 E8 BF
B1 D7 AA 33 C2 F5 E8 3F EB 89 13 B4
6B 9A 94 44 97 FD 5B C2 5D 06 DA C2
1.819999 -7.955471e-8 5.496247e-7
5.496247e-7 -1.374061e-7 -1.819999
7.955475e-8 1.819999 -1.374061e-7
1188.825561 -54.997646 -109.012428
initial position transform matrix
0x48 matrix
C2 F5 E8 3F 00 00 00 00 00 00 00 00
00 00 00 00 C2 F5 E8 3F 00 00 00 00
00 00 00 00 00 00 00 00 C2 F5 E8 3F
00 00 00 00 00 00 00 00 00 00 00 00
1.819999 0.0 0.0
0.0 1.819999 0.0
0.0 0.0 1.819999
0.0 0.0 0.0
fixed transform matrix
0x78 int16 50 00 80 unknown
0x7A int16 F5 01 501 animation length in frames
0x7C int16 00 00 0 unknown
0x7E int16 65 00 10 101 keyframes in array
First keyframe (black outline)
0x00 quaternion
F4 04 35 BF 6A 19 C4 B3 CE 3C 03 B4 F3 04 35 BF
-0.7071068 -9.131584e-8 -1.222244e-7 -0.7071067
object rotation
0x10 vector
C2 F5 E8 3F AB D7 AA B3 EC 89 13 35
1188.825561 -54.997646 -109.012428
object position
0x1C int32 00 00 00 00 0 elapsed time in frames
Transform matrices
Like all matrices in Oni, they are composed of 3 vectors defining rotation/scaling/shearing and a 4th vector defining a translation.
In the above table the 4 vectors are presented as rows (Direct 3D convention), although OpenGL and Oni use them as columns.
Affine transformations use a 4x4 matrix with 4 extra coefficients (in the presentation above, one would add one column on the right):
three projection transform coefficients (all of them are zero here); one final coefficient (always 1.0 for an affine transform matrix).
Alternatively, one can think of the 3x4 matrix as a 3x3 rotation/scaling matrix and a position vector
  • Let X=(x, y, z) be the position of a vertex in the M3GM
  • Let M=(m11, m21, m31; m12, m22, m32; m13, m23, m33) be the 3x3 matrix
  • Let R=(m14, m24, m34) be the translation vector
Then the absolute position of the vertex in the 3D world will be: X M + R
(left multiplication is used because of the row-major notation above)
Initial transform matrix
It is used to position the object in the environment before the animation is played.
When the animation is played, they use the fixed transform matrix and a quaternion.
Fixed transform matrix
This transformation is applied before the quaternion+position transform at every keyframe.
The only transform that can't be handled by the quaternion+position is scaling/mirroring.
Thus, the fixed transform is a scaling matrix most of the time (no rotation or translation).
In the above example, the fixed transform scales the van up by 1.82 (along all three axes).
Quaternions
Those are used in Oni whenever interpolation of 3D rotation is involved (e.g., TRAM rotation)
In this case, rotation at intermediate frames is interpolated from the keyframe quaternions.




ONI BINARY DATA
Mtrl << Other file types >> OBDC
OBAN : Object Animation
Level file