Joshua Barczak CMSC 435 UMBC Animation Joshua Barczak CMSC 435 UMBC
Animation
Animation What’s really going on… Discrete frames Incremental change between frames Illusion of motion
Flip Books Hand drawn frames, packed into large texture N M 0,0 1,0 u = (u + (frame % N)) / N; v = (v + (frame / N)) / M; M 0,0 1,0 0,1 u v libgdx
Animation Traditional Animation Pipeline Lead animator draws “key” frames “In-betweener” draws frames between keys Key Key
Animation Computer Animation Pipeline Animator specifies “key frames” Computer interpolates Key Key
Animation
Keyframing We can key anything we want: Position Rotation Scale Color Texture coordinate Light intensity
Animation
Splines BoatDesign.net
Hermite Spline T0 P1 P0 T1
Piecewise Hermite Splines
Piecewise Hermite Splines Catmull-Rom spline Shared tangents are vectors between neighbor points C1 continuous Endpoint interpolating
Kochanek-Bartels Curves Use different tangents in each segment Artistic control TCB Tension Continuity Bias All zero: Catmull-Rom curve See book, pg 420
Tension T=-1 T=0 T=1 How close it is to a straight line
Create local discontinuities Continuity C=-2 C=0 C=1 Create local discontinuities
Overshoot/Undershoot Bias B=-1 B=0 B=1 Overshoot/Undershoot
Animated Rotation Euler angles Easy to set Doesn’t animate well Rotations about independent axes Yaw/Pitch/Roll Easy to set Doesn’t animate well Gimbal lock Quaternion interpolation used instead Wikipedia
Quaternions Alternate representation for rotations Rotation 2a radians around axis N: Q=[sin(a)N, cos(a)] Convertible to/from rotation matrix Much more compact Stable interpolation
Ancient DirectX SDK sample Vertex Blending Interpolate between meshes Same topology Different vertex positions Models as keyframes Ancient DirectX SDK sample
Ancient DirectX SDK sample Vertex Blending Issues Ease of authoring Difficult to tweak the animation Data size Ancient DirectX SDK sample
Skeletal Animation Skeleton: Hierarchy of joints (bones) Deform a mesh (skin) based on joint rotation Okino.com
Hierarchical Model Torso Head Left Shoulder Hips Upper Arm Lower Arm Hand Hips Left Upper Leg Lower Leg Foot
Forward Kinematics Given a set of joint transforms, where’s the hand? (or foot or head or …) End effector Just apply nested transforms We know how to do that!
FK Example Location of hand: Construct hand to world transform: Head Hand_to_elbow * Elbow_to_shoulder * Shoulder_to_head * head_to_world Hand Shoulder Elbow
Inverse Kinematics Given desired effector position, find joint angles Common Examples: Foot placement Pointing/Grasping Constrained optimization Preserve limb length Arms doesn’t bend that way
Skeletal Animation Motion Capture Track markers on actor Infer joint locations from markers Often significant manual cleanup Kevin Durant at Electronic Arts Motion Capture Studio - AP / Richard Lam
Skinning Model authored in “rest pose” Mesh vertices “bound” to skeletal joints Single joint (rigid) Multiple joints (weighted blend) Okino.com
Skinning For each bone, store: For each vertex: Bind matrix Bone to world transform for rest pose (B) Animation curves Relative to rest pose Parent bone For each vertex: Bone indices and weights Okino.com
Skinning Skinning a vertex Transform into “bind space” Apply an animated offset Transform result up the tree
Skinning // Sample animated bone offsets for( bones ) M[i] = Li(time) // compute new bone->world transforms for( pre-order traversal of skeleton ) M[i] = M[parent[i]] * M[i]; // apply inverse bind matrix M[i] = M[i] * Binv[i]; // Each vertex has position p, weights w[] and bone indices idx[] for( vertices i ) for( bones influences j ) position += w[j]*M[idx[j]]*p
Blend Shapes Commonly used for faces Sculpt key poses Expressions Phonemes Animate pose weights Curve per shape Maya Documentation
Freeform Deformation Define regular grid Move grid points Moves objects Lattice defines a “bezier volume” Sederberg and Parry, 1986
Physics Based Animation Simulate physics to predict motion Starting point for hand animation Things too large/difficult to hand animate In general, must be: Stable Not too slow Art-directible
Simulation Rigid Bodies Simulate physics Detect collisions and apply “penalty forces” Typically: Linear/Angular velocity Discrete time steps Discrete/Continuous collision detection
Simulation Cloth Mass-spring simulations Cloth/Cloth and cloth/object collision response Brad Werth Bridson et al. Robust Treatment of Collisions, Contact and Friction for Cloth Animation
Alliez et al. Variational Tetrahedral Meshing Simulation Soft-Bodies Tetrahedral mesh models Approaches Mass-spring Conserve edge lengths Finite element Conserve volume Alliez et al. Variational Tetrahedral Meshing Irving et al. Volume Conserving Finite Element Simulations of Deformable Models
Simulation Hair Simulate a subset of the hairs Guide hairs Interpolate dense hair model from neighboring guide hairs Direct rendering Millions of anti-aliased lines Chang et al. 2002 Pixar
Coupling Water and Smoke to Thin Deformable and Rigid Shells Simulation Fluid Simulation Grid-based Simulate velocity field on discrete grid Particle based Move particles directly Fluid Rendering Level set surface Guendelman et al. Coupling Water and Smoke to Thin Deformable and Rigid Shells
Simulation Crowds Agent based Continuum based Use AI techniques Emmergent behavior Continuum based Dynamic vector field Congestion/hazards Crowd members as particles Treuille et al. Continuum Crowds