Jump to content

OBD:OBAN: Difference between revisions

m
wording
No edit summary
m (wording)
 
(12 intermediate revisions by 4 users not shown)
Line 1: Line 1:
{{OBD_File_Header | type=OBAN | prev=Mtrl | next=OBDC | name=Object Animation | family=Level | align=center}}
{{OBD_File_Header | type=OBAN | prev=Mtrl | next=OBDC | name=Object Animation | family=General | desc='''OBAN'''s are arrays for storing keyframes in an object or camera animation, as well as basic info like whether the animation loops, and how it does so. | align=center}}




[[image:oban_a.gif]]
[[Image:oban_a.gif]]




Line 10: Line 10:
{{OBDtr|0x04|lev_id|FFFF00|01 00 00 '''06'''|3  |level 3}}
{{OBDtr|0x04|lev_id|FFFF00|01 00 00 '''06'''|3  |level 3}}
{{OBDtr|0x08|char[12]|00FF00|00 00 00 00    |0  |padding }}
{{OBDtr|0x08|char[12]|00FF00|00 00 00 00    |0  |padding }}
{{OBDtr|0x14|int32   |00FF00|00 00 00 00    |0  |flags; used values:  
{{OBDtr|0x14|uint32   |00FF00|00 00 00 00    |0  |flags; used values:  
:0x'''01''' 00 00 00 - loop animation normally
:0x'''01''' 00 00 00 - loop animation normally
:0x'''02''' 00 00 00 - loop animation back to back
:0x'''02''' 00 00 00 - loop animation back to back
:0x'''04''' 00 00 00 - select start frame randomly
:0x'''04''' 00 00 00 - select start frame randomly
:0x'''10''' 00 00 00 - 3DSMax generated animation (has Z axis pointing up)
:0x'''08''' 00 00 00 - autostart animation (after an animated object is created)
:0x'''10''' 00 00 00 - local animation; this animation does not contain world positioning information, the object position is determined by the origin matrix in [[OBOA]]; local animations also use a Z-up coordinate system
}}
}}
|- ALIGN=CENTER VALIGN=TOP
|- ALIGN=CENTER VALIGN=TOP
Line 62: Line 63:
|}
|}
| ALIGN=LEFT | fixed transform matrix
| ALIGN=LEFT | fixed transform matrix
{{OBDtr|0x78|int16|B0C3D4|50 00|80  | fubared animation frame length; does not work}}
{{OBDtr|0x78|uint16|B0C3D4|50 00|80  | ticks per frame; does not work}}
{{OBDtr|0x7A|int16|E7CEA5|F5 01|501 | animation length in frames}}
{{OBDtr|0x7A|uint16|E7CEA5|F5 01|501 | animation length in frames}}
{{OBDtr|0x7C|int16|FFDDDD|00 00|0  | stop frame for the first "half" of the animation; used by door animations to distinguish between open and close sequences }}
{{OBDtr|0x7C|uint16|FFDDDD|00 00|0  | stop frame for the first "half" of the animation; used by door animations to distinguish between open and close sequences }}
{{OBDtr|0x7E|int16|64AAAA|65 00|10 | 101 keyframes in array}}
{{OBDtr|0x7E|uint16|64AAAA|65 00|101 | number of keyframes}}
{{OBDtrBK|First keyframe (black outline)}}
{{OBDtrBK|First keyframe (black outline)}}
|- ALIGN=CENTER VALIGN=TOP
|- ALIGN=CENTER VALIGN=TOP
Line 71: Line 72:
{|border=1 cellspacing=0 style="white-space:nowrap"
{|border=1 cellspacing=0 style="white-space:nowrap"
|-BGCOLOR="#EBEBEB"
|-BGCOLOR="#EBEBEB"
| F4 04 35 BF||6A 19 C4 B3||CE 3C 03 B4||F3 04 35 BF
| F4 04 35 BF
|-BGCOLOR="#EBEBEB"
| 6A 19 C4 B3
|-BGCOLOR="#EBEBEB"
| CE 3C 03 B4
|-BGCOLOR="#EBEBEB"
| F3 04 35 BF
|}
|}
|
|
{|border=1 cellspacing=0 style="white-space:nowrap"
{|border=1 cellspacing=0 style="white-space:nowrap"
| -0.7071068|| -9.131584e-8|| -1.222244e-7|| -0.7071067
| -0.7071068
|-
| -9.131584e-8
|-
| -1.222244e-7
|-
| -0.7071067
|}
|}
|ALIGN=LEFT|object rotation
|ALIGN=LEFT|object rotation
Line 89: Line 102:
|}
|}
|ALIGN=LEFT|object position
|ALIGN=LEFT|object position
{{OBDtr|0x1C|int32|FF00C8|00 00 00 00  |0  |elapsed time in frames}}
{{OBDtr|0x1C|uint32|FF00C8|00 00 00 00  |0  |current frame}}
|}
|}
Object animations are used for [[OBD:OBOA|moving objects]] (doors included), [[OBD:TRIG|triggers]], the camera, and characters. These animations change the rotation and position of the object and do not involve changes to the model geometry. Object animations may be referenced from OBOA but they can also be set using [[env_setanim]] script command. Camera animations are never referenced from data; they're started from scripts using [[cm_anim]] or [[cm_interpolate]]. Because of this the only way to tell if an animation is intended for the camera or for an object is to look at the level scripts.
Characters can have an object animation applied to them by using [[chr_envanim]]. The object animation controls the movement of the character and it's normally used together with a [[TRAM]] that has the 'real world' flag set. This can be used to make the character appear attached to another animated object, for example Konoko riding her motorcycle in the opening of Chapter 3.


;Transform matrices
;Transform matrices
:Like all matrices in Oni, they are composed of 3 vectors defining rotation/scaling/shearing and a 4th vector defining a translation.
: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 ([[Wikipedia:row-major_order|Direct 3D convention]]), although OpenGL and Oni use them as columns.
:In the above table the 4 vectors are presented as rows ([[wp:Row-_and_column-major_order|Direct 3D convention]]), although OpenGL and Oni use them as columns.
:[[Wikipedia:Transformation_matrix#Affine_transformations|Affine transformations]] use a 4x4 matrix with 4 extra coefficients (in the presentation above, one would add one column on the right):
:[[wp:Transformation_matrix#Affine_transformations|Affine transformations]] use a 4x4 matrix with 4 extra coefficients (in the presentation above, one would add one column on the right):
::three [[Wikipedia:3D_projection|projection transform]] coefficients (all of them are zero here); one final coefficient (always 1.0 for an affine transform matrix).
::three [[wp:3D_projection|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
: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 X=(x, y, z) be the position of a vertex in the M3GM
Line 104: Line 122:
::(left multiplication is used because of the row-major notation above)
::(left multiplication is used because of the row-major notation above)
;Initial transform matrix
;Initial transform matrix
:It is used to position the object in the environment before the animation is played.
:It is used to position the object in the environment before the animation is played, it coresponds to the first animation frame.
:When the animation is played, they use the fixed transform matrix and a quaternion.
:When the animation is played, they use the fixed transform matrix and a quaternion.
;Fixed transform matrix
;Fixed transform matrix
Line 118: Line 136:
----
----
----
----
{{OBD_File_Footer | type=OBAN | prev=Mtrl | next=OBDC | name=Object Animation | family=Level | align=center}}
{{OBD_File_Footer | type=OBAN | prev=Mtrl | next=OBDC | name=Object Animation | family=General | align=center}}
 
{{OBD}}