TAILIEUCHUNG - Character Animation with Direct3D- P10
Character Animation with Direct3D- P10:This book is primarily aimed at teaching indie and hobby game developers how to create character animation with Direct3D. Also, the seasoned professional game developer may find some interesting things in this book. You will need a solid understanding of the C++ programming language as well as general object-oriented programming skills. | This page intentionally left blank lease purchase PDF Split-Merge on to remove this watermark. 8 Morphing Animation So far this book has looked only at skeletal animation. In today s games this method is used almost exclusively to animate the game characters movements. However it wasn t always so. For example the first Quake game used characters animated using morphing animation instead. This chapter covers the basics of morphing animation also known as per-vertex animation . This concept will also be taken one step further by combining morphing animation with skeletal animation In this chapter you ll find Introduction to morphing animation Morphing animation on the GPU with vertex shaders Combining morphing animation with skeletal animation 167 sase purchase PDF Split-Merge on to remove this watermark. 168 Character Animation with Direct3D Basics of Morphing Animation In skeletal animation each vertex was linked to one or more bones with associated weights. In morphing animation however two or more positions are stored per vertex and are simply blended using linear interpolation LERP . Each predefined vertex position is called a morph target. Once you have a list of morph targets you can blend between them using weights just as in skeletal animation as shown in the following formula vi xp yv Zx v2 x2 y2 z2 v v2 p vx 1 - p The equation above describes how to create a blended vertex v between the two morph targets vx and v2 using simple LERP . This same example is also illustrated in Figure where a new vertex position is calculated with a weight of 32 FIGURE Blending the position of a single vertex using two morph targets and one weight. In the same way the position of the vertex is animated you can also animate the vertex normal UV coordinates etc. The following code is an excerpt from Example where a morphed mesh is created from two target meshes. A morphed mesh is created from two target meshes by performing the blend .
đang nạp các trang xem trước