Lecture 12 Skeletal animation Software Engineering and Game















- Slides: 15

Lecture 12 --- Skeletal animation Software Engineering and Game Development Elias Holmlid 1

Today’s plan �First, going to finish off what we did yesterday �Then. . . animation Keyframed animation Skeletal animation Elias Holmlid 2

Key framed animation �Also called per-vertex animation or morph- target animation �Define a few frames, then fill in the blanks (tweening) Elias Holmlid 3

Key framed animation on meshes �Static mesh model for each frame �Only the key frames are exported �Good for facial animation �Used in Quake II and Quake III for example Elias Holmlid 4

Skeletal animation �A hierarchical set of bones �Possible to blend different animations together (smooth run->idle for example) Elias Holmlid 5

Skeletal animation �Each frame, we can represent the transform for each bone as a matrix �This is called a matrix palette, i. e. an array of matrices Elias Holmlid 6

Skeletal animation �Vertex blending Each vertex in the mesh can be influenced by several bones ▪ Final position of vertices calculated as a weighted average of the influencing bones ▪ Thus, smooth transitions can be achieved at joints �Usually, four bones / vertex is enough �Each vertex contains blend indices and blend weights. Elias Holmlid 7

Skeletal animation �Only bones. . . Elias Holmlid 8

Skeletal animation �Skinned bones. . . Elias Holmlid 9

Inverse kinematics �Find out how to rotate bones in order to end up at a desired position � http: //www. youtube. com/watch? v=t. OAFCv. Sn. NDc Elias Holmlid 10

Ragdoll physics �Often used in death animations �Place constraints on how the skeleton’s bones can move in relation to each other Then use physical simulation on bones Elias Holmlid 11

Ragdoll Physics �http: //www. youtube. com/watch? v=gbu. A- HEb. ROk �http: //www. youtube. com/watch? v=Ws. EHxwhv 90 Elias Holmlid 12

Skeletal animation in XNA �. X and. FBX formats support skeletal animation . FBX concatenates all tracks into a single timeline . X supports more than one track I’ve had most luck using the k. W X-port plugin for 3 D-studio (http: //www. kwxport. org/). Elias Holmlid 13

Skeletal animation in XNA Content pipeline needs to be extended Elias Holmlid 14

What has to be implemented? �Animated Model Processor �Content. Type. Writer �Content. Type. Reader �Classes for storing the data during runtime Compiled as a library ▪ Keyframe (stores a keyframe for one bone) ▪ Animation. Data (stores one animation) ▪ Animated. Model. Data (stores skeleton+all animations) �Skinned Effect Elias Holmlid 15