Animating Objects


Associated with the movement of objects is the processing of animation. Animated objects have one or more animations stored with the object as part of its definition. An animation can be thought of as a timed sequence of child object position changes relative to the objects main object. Examples of animations for a humanoid object could be running, jumping, crouching , firing a weapon, etc. Animation rates are typically specified in frames per second. Based on this rate and the duration of the animation, we can calculate the number of frames of animation data we will need to have for a given animation. We can also calculate the fraction of a second that expires between frame points. It is important to reconcile the values between the animation time step and the rendering time step. If the two values are different and we time the animation rate to the rendering rate, the animation will run either too slow or too fast. The solution to this problem is called tweening.

Tweening is the process of interpolating between animation positions. Think of it along the lines of linear interpolation between each pair of point positions . Humanoid animation is typically based on a system of bones. Bones make up an invisible skeleton within the humanoid mesh. Each bone is a child object of the humanoid object, and one or more bones influence designated mesh vertices. Using this method, the mesh is manipulated as the position of bones are changed during the animation. Another advantage to this method is the amount of information that is required to define an animation. We do not need to define a position for every single vertex for every frame of the animation. Instead, we store bone position information for each animation frame. The movement of the bones as the animation proceeds decides the position of each vertex of the mesh for the rendered frame. An example of this process is provided by Microsoft with the SDK in the SkinnedMesh sample. The important thing is that at this point in the process we must determine the current frame of animation (or calculate the tween values) and position the vertices of the mesh appropriately.




Introduction to 3D Game Engine Design Using DirectX 9 and C#
Introduction to 3D Game Engine Design Using DirectX 9 and C#
ISBN: 1590590813
EAN: 2147483647
Year: 2005
Pages: 98

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net