2.9 Skeletal Animation

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

2.

9 Skeletal Animation
Skeletal animation is a process of animating a mesh by moving a set of hierarchical bones within
the mesh, which in turn moves the vertices of the model according to the bone assignments stored
in each vertex. An alternative term for this approach is 'skinning'. The usual way of creating these
animations is with a modelling tool such as Milkshape 3D, Blender, 3D Studio or Maya. OGRE
provides exporters to allow you to get the data out of these modellers and into the engine See
section 4.1 Exporters.

骨骼动画是通过移动 mesh 中一系列有等级关系的骨头来使 mesh 拥有动画效果的过程。


移动方法是根据存储在每个顶点的骨头分配来顺序移动模型的头结点。这种方案的一种可
选方法是’skinning’。创建这种动画的通常方法是使用建模工具,例如 Milkshape 3D,
Blender, 3D Studio 或是 Maya。OGRE 提供导出工具来帮助你得到使用建模工具获得的并且
可以用到引擎中的数据。详见 4.1 Exporters。

There are many grades of skeletal animation, and not all engines (or modellers for that matter)
support all of them. OGRE supports the following features:

有很多种的骨骼动画,并且不是所有引擎(或是建模工具)都支持他们。OGRE 支持以下的
特点:
 Each mesh can be linked to a single skeleton

每一个 mesh 可以链接到一个单独的骨骼中

 Unlimited bones per skeleton

每个骨骼都是不受限的骨头

 Hierarchical forward-kinematics on bones

骨头间是分等级的前项运动

 Multiple named animations per skeleton (e.g. 'Walk', 'Run', 'Jump', 'Shoot' etc)

每个骨骼可以是多名称动画

 Unlimited keyframes per animation

每个动画没有限制关键帧的数量

 Linear or spline-based interpolation between keyframes

线性或基于样条的关键帧插值
 A vertex can be assigned to multiple bones and assigned weightings for smoother
skinning

一个顶点被赋值到多块骨头上同时也赋值到平滑的皮肤上

 Multiple animations can be applied to a mesh at the same time, again with a blend
weighting

多个动画可以同时应用到一个 mesh 上,产生额外的混和效果

Skeletons and the animations which go with them are held in .skeleton files, which are produced
by the OGRE exporters. These files are loaded automatically when you create an Entity based on a
Mesh which is linked to the skeleton in question. The entity is then given an 'animation state'
object per animation on the skeleton to allow you to specify the animation state of that single
entity (you can animate multiple entities using the same skeleton, OGRE sorts the reuse out
internally).

骨骼和动画一起放在.skeleton 文件中,这类文件由 OGRE 的导出工具产生。当你创建一个基


于链接到骨骼的 mesh 的实体时,这些.skeleton 文件会被自动加载。然后实体在骨骼中每个
动画给一个“动画状态”对象,这样就允许你确定单实体的动画状态(你可以使用同一个
骨骼产生多个实体,OGRE 会自动挑拣处这些重复使用的)。

You can retrieve a pointer to the AnimationState object by calling Entity::getAnimationState. You
can then call methods on this returned object to update the animation, probably in the frameStarted
event. AnimationState has a very simple method 'addTime' which allows you to alter the
animation position incrementally, and it will automatically loop for you. addTime can take
positive or negative values (so you can reverse the animation if you want).

你可以通过调用 Entity::getAnimationState 方法来获取一个指向动画状态对象的指针。这样你


可 以 通 过 调 用 这 个 对 象 上 的 方 法 来 更 新 动 画 , 这 可 能 发 生 在 frameStarted 事 件 中 。
AnimationState 有一个很简单的方法'addTime',它允许你离开改变动画的位置,并且它会为
你自动循环处理。AddTime 有可能给你带来好处,同时也有负面影响(如果你想要,你可
以反转动画)。

You might also like