THE BASICS OF ANIMATIONS
By José Pablo Luna Sánchez. 2008
SEQ is a sequence of movements that form an animation.
It describes an animation, like raising or lowering landing gear, which is composed of several movements of several pieces.
The basic pieces used for animation are mesh groups.
COMP is a component of an animation applied to single or multiple pieces.
It describes single movement of parts that form an action.
A sequence is composed by several components.
Components refer to a certain sequence.
In this example we have 2 animations.
One will move all parts of landing gear, and another will move all control surfaces (we could imagine an automated control surface test).
In this example each component will move one group only, but in real cases, a component could act upon many mesh groups.
Components can perform one single action:
So if you want more complex movements you need to combine components in a single sequence.
Animations refer to certain existing groups of the mesh.
Example
[ANIM_SEQ_0]
; landing gear
KEY=G
DURATION=6.7[ANIM_COMP_0]
;nose wheel
SEQ=0
GROUPS=92,96
RANGE=(0.0,0.7)
ROT_PNT=(0,-1.048,8.561)
ROT_AXIS=(1,0,0)
ANGLE=95.[ANIM_COMP_1]
;front cover
SEQ=0
GROUPS=62,81
RANGE=(0.0,0.6)
ROT_PNT=(0,-1.145,8.65)
ROT_AXIS=(1,0,0)
ANGLE=90.
THE ANIMATION TIMELINE
We may imagine a timeline that extends from zero to one.
SEQ will extend from 0 to 1 or viceversa.
State 0 is normally the current state in the mesh.
For example, if a mesh has landing gear retracted, then state 0 would be landing gear retracted.
State 1 would be landing gear extended.
The timeline will extend from those two states.
In the graphical example above, COMP 0 movement will extend from 0.2 to 0.8 in the timeline, COMP 1 will go from 0.5 to 1.
SEQ definition has 3 ways to move across the timeline, using the command REPEAT.
REPEAT modes are:
An animation will have a series of movements.
A landing gear being extended or retracted may include complex motion for wheels and doors.
Each single movement will be described by a COMP.
COMP motion is composed by a single movement, applied to a certain list of groups, and it extends from one point to another along the timeline .
When animation moves across the timeline and it reaches the range between those two points, then COMP starts to act upon the mesh.
Those 2 points are defined by the RANGE command.
SEQ COMMANDS
These commands are more explained in the manual of Spacecraft.dll ( \Add-on Docs\spacecraft.pdf )
INIT_POS=<Value> | A value between 0 and 1. |
KEY=<Key> | Indicates what key you are going to use to trigger the animation. |
DURATION=<Seconds> | How long the animation will take |
REPEAT=<Mode> | The way to conduct looped movement |
PAUSE=<Mode> | Enable/disable pause mode |
Notice than not all commands must be present for a given animation.
Use those that you may need.
Example:
[ANIM_SEQ_1]
INIT_POS=0
KEY=K
DURATION=5
REPEAT=0
PAUSE=0
In this example the animation will start in state 0.
Animation is activated by K key and it will last 5 seconds.
It will not repeat the animation and pause mode is disabled.
COMP COMMANDS
ROTATION
A good use for rotation would be to rotate a retractable landing gear, for example.
As you may notice, to define a rotation we need a vector and a point that could be located anywhere along the rotation axis.
Also you may notice that you may have to possible directions for the vector to point.
The direction of the vector will determine the direction of rotation.
I am not covering vectors here.
I made a tutorial on vectors that is posted at www.orbithangar.com
If you have a vector, to invert the direction of the vector, just invert the signs of all 3 vector components.
For example, if your vector is (3,2,-1) a vector pointing in the opposite direction would be (-3,-2,1).
Example:
[ANIM_COMP_2]
SEQ = 5
GROUPS=1,3
TYPE=ROTATE
RANGE=(0,0.5)
ROT_PNT=(0.002579,1.993670,0.238158)
ROT_AXIS=(-1,0,0)
ANGLE = 90
PARENT=1
This component number 2 is part of sequence 5, so it means you previously defined SEQ 5 in the INI code.
This component will apply animation to groups 1 and 3.
Component type is rotation.
Rotation is the movement that will be performed by this component.
Component will act between state 0 and state 0.5
Point of rotation is:
Vector for rotation is
Notice length of vector must be 1 (normalized vector).
Also, the rotation is going to rotate groups by an angle of 90 degrees when it is put in motion.
Parent component is component 1.
Parent component means that the 3D movement settings of parent component 1 (the technical term is 3D transformation) are applied before applying movement of current component.
TRANSLATION
Translation is the equivalent of moving an object from one position to another.
Translation does not use pivot point, rotation axis vector and rotation angle.
It uses only a translation offset called SHIFT which is a vector that indicates how much should parts be moved.
Example:
[ANIM_COMP_3]
SEQ = 6
GROUPS=1,3
TYPE=TRANSLATE
RANGE=(0.1,0.5)
SHIFT=(10,1,6)
This is component 3.
It belongs to sequence 6.
It will act upon groups 1 and 3.
It will start at 0.1 and will end at 0.5 in the timeline.
It will move those groups 10 meters along X axis, 1 meter along Y axis and 6 meters along Z axis.
There is no parent component.
SCALING
It involves changing the size of an object from a pivot point.
It uses a Pivot point (called REF) and a scaling factor in all 3 axes that is represented by 3 numbers (one per axis).
Example:
[ANIM_COMP_4]
SEQ = 8
GROUPS=3,5,9
TYPE=SCALE
RANGE=(0.6,0.9)
SCALE=(10,1,6)
REF=(3,3.5,6.8)
This is component 4 and belongs to sequence 8.
It will act upon groups 3, 5 and 9 of the mesh.
It extends from 0.6 to 0.9 in the timeline.
It will scale 10 times in X axis, and 6 times in Z axis. There will be no change in Y axis.
Scaling will be done using the following coordinates
as scaling center:
X = 3
Y = 3.5
Z = 6.8
There is no parent component.
WHY DO YOU NEED ANIMATIONS?
If you want to see examples of animation, you may try downloading add-ons made by Greg Burch from www.orbithangar.com
I would recommend to download Big Space Plane 4 and Building Blocks 4.0 and 4.1, which are great addons that take Spacecraft3.dll to the limit.