19,585
edits
No edit summary |
m (wording) |
||
(6 intermediate revisions by 3 users not shown) | |||
Line 1: | Line 1: | ||
{{OBD_File_Header | type=OBAN | prev=Mtrl | next=OBDC | name=Object Animation | family= | {{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]] | ||
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| | {{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 | ||
Line 63: | Line 63: | ||
|} | |} | ||
| ALIGN=LEFT | fixed transform matrix | | ALIGN=LEFT | fixed transform matrix | ||
{{OBDtr|0x78| | {{OBDtr|0x78|uint16|B0C3D4|50 00|80 | ticks per frame; does not work}} | ||
{{OBDtr|0x7A| | {{OBDtr|0x7A|uint16|E7CEA5|F5 01|501 | animation length in frames}} | ||
{{OBDtr|0x7C| | {{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| | {{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 72: | 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 90: | Line 102: | ||
|} | |} | ||
|ALIGN=LEFT|object position | |ALIGN=LEFT|object position | ||
{{OBDtr|0x1C| | {{OBDtr|0x1C|uint32|FF00C8|00 00 00 00 |0 |current frame}} | ||
|} | |} | ||
Object animations are used | |||
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 ([[ | :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. | ||
:[[ | :[[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 [[ | ::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 121: | Line 136: | ||
---- | ---- | ||
---- | ---- | ||
{{OBD_File_Footer | type=OBAN | prev=Mtrl | next=OBDC | name=Object Animation | family= | {{OBD_File_Footer | type=OBAN | prev=Mtrl | next=OBDC | name=Object Animation | family=General | align=center}} | ||
{{OBD}} | {{OBD}} |