Skeletal Animation 1

Xtreme3D

Lesson 9
Basics of the skeletal animation

Level: Beginner
Version of the Xtreme3D: 3.0.x
Author: Gecko

Sometimes opportunities ���������� animation is not enough. This is the case, basically, games of the genre of action. For example, you may want to "give" their hero into the hands of the weapons or "wear" armor. When using the topmost animations it is impossible (with rare exceptions). In addition, the ��������� animation can require too much memory for storage of frames. Therefore, if you are using the model with a large number of polygons, wise will select the skeletal animation.
Instead of storing the key frames (as in the case of The ���������� animations) for each of the poses of the character, the use of skeletal animation implies one model in the neutral position and a large set of matrices that transform the various parts of the model. These matrices conditionally called bones. To each of the Bones tied group of vertices. One vertex can "belong" to multiple bones immediately, with varying degrees of influence that makes the animation more natural (This property is called the bone �����������).
For the first time, this technology has been used in the game Half-Life, and Xtreme3D supports the format of the models of Half-Life - SMD. As an alternative to the SMD, also supported by the format of the models of Doom III - the MD5.

To download the models with the skeletal animation is used, the same object Actor. You do not need to also specify, Xtreme3D is able to recognize the type of models and tune to the correct type of animation:

Actor = ActorCreate('model.smd', matlib, matlib, global.scene);

The peculiarity of the SMD format is that the animation model is stored in a separate file, which also has an extension *.smd. Such files can be several. In theory, this method allows you to use the same animation files for different models (if they have the same skeleton).
After the creation of the actor should add these files:

ActorAddObject(actor, 'animation1.smd');
ActorAddObject(actor, 'animation2.smd');
ActorAddObject(actor, 'animation3.smd');

When you add the next smd file, to the animations of the actor adds a new group training, which is assigned a sequence number. The count is 1. That is, if we now ������������ to Group 2:

ActorSwitchToAnimation(actor, 2, false);

...It will be lost animation loaded from a file animation2.smd.

The skeletal animation apply all the features that we considered in the previous lesson.