1 of 108

Introduction to �Computer Animation�Zoë Wood Ian Dunn

2 of 108

Animation

  • When generating motion what matters?
    • Quality of motion appropriate for rendering style and frame rate
    • Controllable from UI
    • Controllable from AI
    • Skills of the animated character
    • Personality of the animated character

3 of 108

How do we animate…

Modifying scene parameters as a function of time

  1. Scripting
  2. Forward Kinematics/Key framing
  3. Inverse Kinematics
  4. Motion capture
  5. Simulation
    1. Behavioral Animation
    2. Physically based�(Dynamics)

4 of 108

Scripting

Specifying the parameters at every frame

define spinningCube()

rotAngle = pi*frameNumber / 50

define carScript()

carTranslation = 10*(frameNumber / 100)

wheelRotation = pi*frameNumber / 5

5 of 108

Implications for geometry

  • Some structure with parameters
    • Hierarchical �model

Hip

Torso

l.Leg1

r.Leg1

l.Leg2

r.Leg2

Shoulder

Neck

Head

r.Arm1

l.Arm2

r.Arm2

l.Arm1

6 of 108

How do we animate…

Modifying scene parameters as a function of time

  1. Scripting
  2. Key framing
  3. Inverse Kinematics
  4. Motion capture
  5. Simulation
    1. Behavioral Animation
    2. Physically based�(Dynamics)

7 of 108

Keyframing

  • Sometimes we’d like better control over the motion
  • Thus have an artist do the hard work = Key frames

Disney

8 of 108

Keyframing

Specify only the important frames,

interpolate the frames in-between

What and how to interpolate is important

interpolating angle

interpolating endpoints

9 of 108

Keyframe Example

10 of 108

Interpolation

  • In order to procedurally generate the in-between frames, use interpolation
    • Implies we need a point to point correspondence between animation frames

Linear interpolation

11 of 108

Transformations

  • What will we be interpolating?
    • Transforms
    • (which are? 4x4 matrices)
    • With respect to a particular frame

12 of 108

Rotation

  • How do you interpolate rotations?
    • You can decompose your rotation into 3 Euler rotations
    • have problems
      • Unnatural
      • Gimbalq lock

13 of 108

Quaternions

  • Representation:
    • w is a scalar
    • c is a vector (3D)
  • A rotation by an angle of theta �around an axis of k is:
  • Interpretation,�a point on the unit sphere in R4

14 of 108

Quaternion

  • To interpolate, slerp or lerp
    • Given R0 and R1��
    • You can interpolate by scaling alpha and computing the quaternion:

15 of 108

Choosing Animation Properties

  • Interpolation vs. Approximation
    • Pass through the point or come close enough?
  • Computational Complexity
    • 1st, 2nd, or 3rd order polynomials?
  • Continuity
    • Allow for kinks or require smoothness?
  • Global vs. Local Control
    • Change one point will change all or only small part of the path?

16 of 108

Interpolating Translations

Interpolate using a cubic B spline

Use an arc length parameterization

17 of 108

Controlling motion along a path

  • Speed Control
    • Given p(t)= the animation path, t is not tied to the function’s arc length and will cause the object to move at different speeds

18 of 108

Spline-driven Animation

x,y = Q(u)

for u:[0,1]

  • Equal arc lengths
  • Equal spacing in u

x

y

19 of 108

Computation of Arc Length

  • Need to parameterize t in terms of the Arc Length
  • Thus, we need to know how to compute the arc length of a curve
  • If we know the length traveled by the object along the path, we can then control the speed at which it traverses this curve.
    • Can be solved analytically
    • Or numerically

20 of 108

Keyframing Interpolation

  • Inbetweening

20

1,2,3 4 5 6 7,8,9…

Linear

v

1,2,3 4 5 6 7,8,9…

Slow in, Slow out

v

time

time

21 of 108

Interpolating Rotations

  • Objects not only traverse but also rotate, so we must also be able to interpolate different angular poses of an object
  • First problems becomes one of representation of the angular state of the object.

22 of 108

Representing Rotations

  • Fixed Angle Representations
    • Rotations around the world axes
  • Euler Angle Representations
    • Local coordinate system
  • Axis and angle Representations
    • Like OpenGL
  • Quaternions

Euler angles

23 of 108

Basics of Quaternions

  • Q=[s,v], where s is a scalar and v is a 3-tuple
  • Quaternions are very similar to the axis and angle representations, but due to its specific way of being specified, we are able to carry out quaternion mathematics which are quite useful

24 of 108

Keyframing

  • Decisions about interpolation
    • What and how
  • Fine level of control
  • Quality of motion depends on skill of animator

Disney

25 of 108

Implications for geometry

  • What is being key-framed?
    • Hierarchical model?
    • Skeleton+skin?
    • Also ‘path’ must be represented

26 of 108

More about skeletons+skin

  • Two part representation
    • Skeleton/bones/rig
    • Mesh/skin

Bones in green

27 of 108

skinning

  • Rigid skinning associates one bone per vertex
  • Smooth skinning weights vertices
    • To interpolate transforms of n neighboring bones

http://www.okino.com/conv/skinning.htm

28 of 108

skinning

29 of 108

How do we animate…

Modifying scene parameters as a function of time

  1. Scripting
  2. Key framing
  3. Inverse Kinematics
  4. Motion capture
  5. Simulation
    1. Behavioral Animation
    2. Physically based�(Dynamics)

30 of 108

Kinematics

The study or specification of motion,

independent of the underlying physics

that created the motion

Articulated Figure

A figure made up of a series of links (bones)

connected at joints

31 of 108

Kinematics

Degrees of Freedom (DOF)

End Effector

State Vector

The vector of independent variables

describing the state of the articulated figure

Number of variables in the state vector

The pose of the end of a chain of links

32 of 108

Forward Kinematics

Given the state vector,

calculate the pose of the end effector

33 of 108

kinematics

  • Forward kinematics is the application of motion to the hierarchical model given constraints on the motion
    • Pose each joint individually

Maya user guide

34 of 108

Inverse kinematics

  • Given
    • an initial pose
    • A final pose
    • Joint �constraints
  • Solve for the �intermediate �frames

Maya user guide

35 of 108

Inverse Kinematics

Given the pose of the end-effector,

calculate the state vector

36 of 108

Inverse Kinematics

The kinematic function is usually highly nonlinear

and hard to invert

Consider it as locally linear

37 of 108

Inverse Kinematics

Calculating the Jacobian

38 of 108

Implications for geometry

  • Kinematics applied to?
    • Hierarchical model?
    • Skeleton+skin?
    • (no path but state and time)

39 of 108

How do we animate…

Modifying scene parameters as a function of time

  1. Scripting
  2. Key framing
  3. Inverse Kinematics
  4. Motion capture
  5. Simulation
    1. Behavioral Animation
    2. Physically based�(Dynamics)

40 of 108

Motion Capture

  • Natural-looking motion
  • Hard to generalize motions
    • Registration is difficult
    • “Weightless” according to professional animators

40

41 of 108

Motion Capture�Images courtesy Microsoft Motion Capture Group

Feb 13, Spring 2002

CS 4455

41

42 of 108

Implications for geometry

  • Acquisition (registration)
  • Mapping to existing geometry (bones+skin)

43 of 108

How do we animate…

Modifying scene parameters as a function of time

  1. Scripting
  2. Key framing
  3. Inverse Kinematics
  4. Motion capture
  5. Simulation
    1. Behavioral Animation
    2. Physically based�(Dynamics)

44 of 108

Simulation (Broadly Defined)

  • Physics is hard to simulate
  • Pseudo-physics is somewhat hard
  • Control is very hard
  • Gives Generalization + Interactivity

44

User/AI

Desired

Behavior

Control

Forces and Torques

Model

Numerical Integrator

Graphics

State

45 of 108

Example – shark animation

K. Blizard

User/AI

Desired

Behavior

Control

Forces and Torques

Model

Numerical Integrator

Graphics

State

46 of 108

Behavioral Animation

Animating by describing an actor’s behavior

An actor’s behavior defines how the actor

interacts with other actors and the environment

TRex()

if(player is close)

eatPlayer()

else if(can see player)

chasePlayer()

else

wander()

47 of 108

Behavioral Animation

Boids (birds) [Reynolds87]

  1. Collision Avoidance

avoid collisions with �nearby flockmates

  • Velocity Matching

match velocity with nearby flockmates

  • Flock Centering

stay near centroid of nearby flockmates

48 of 108

Behavioral Animation

Useful for crowd animations

49 of 108

Group Behaviors

  • Lots of background characters to create a feeling of motion
  • Make area appear interesting, rich, populated

49

50 of 108

Flocking -- (HalfLife, Unreal)

  • What might go wrong?

50

Simple version:

Compute trajectory to head towards centroid

51 of 108

Group Behaviors

  • Reaction to neighbors

51

Craig Reynolds

SIGGRAPH 1987

52 of 108

Particles

  • Flocking quickly becomes a sub-problem of a particle system simulation….
  • Can be used generally to represent fluid (smoke, fire works, etc.)
  • Each particle contains local state
    • Position
    • Velocity
    • Age
    • Lifespan
    • Rendering properties

53 of 108

Dynamics

Particle Systems [Reeves83]

  1. Create new particles

  • Assign initial attributes

  • Remove dead particles

  • Update particles

  • Render particles

54 of 108

Physically based animation/Dynamics

Using “physics” to define the animation

Can use “augmented” laws of physics

For example

(1)

55 of 108

ODE basics

  • To do things right, its worth looking at foundations…
  • Physically based modeling (Baraff and Witkin)

56 of 108

Physically based modeling (Witkin)

57 of 108

Physically based modeling (Witkin)

58 of 108

Physically based modeling (Witkin)

59 of 108

Physically based modeling (Witkin)

60 of 108

Physically based modeling (Witkin)

61 of 108

Physically based modeling (Witkin)

62 of 108

Physically based modeling (Witkin)

63 of 108

Physically based modeling (Witkin)

64 of 108

Physically based modeling (Witkin)

65 of 108

Physically based modeling (Witkin)

66 of 108

Physically based modeling (Witkin)

67 of 108

Physically based modeling (Witkin)

68 of 108

Physically based modeling (Witkin)

69 of 108

Solver and particles

70 of 108

Forces acting on particles

  • Constant (e.g. gravity)
  • Position/time (e.g. force fields)
  • Velocity-dependent (e.g. drag)
  • N-ary (e.g. springs)

http://anthonymattox.com/tag/perlin-noise

71 of 108

springs

  • Attach your particles together with springs

72 of 108

cloth

  • Model cloth as mass springs system

73 of 108

Baraff and Witkin continued

  • Implicit methods
    • Re-write & use matrix inversion to solve
  • Rigid bodies
  • Collisions
    • Resting contact

74 of 108

Implications for geometry

  • Soft body deformations �can be achieved with �mass springs
  • Rigid body
  • Representation complexity, not in geometry but in state

75 of 108

Collision Detection

  • Essential for many games
    • Shooting
    • Kicking, punching, beating, whacking, smashing, hitting, chopping, dicing, slicing, julienne fries…
    • Car crashes
  • Expensive
    • tests!!

75

76 of 108

Geometry is not enough…

  • Many tasks in computer graphics include spatial queries
    • Spatial data structures:
      • Uniform grid
      • Adaptive oct-tree
      • BSP tree
      • Bounding volume hierarchy
    • And other for animation, state, �path, time

77 of 108

When to Use What Method?

  • Keyframing
    • Sprites and other simple animations
    • Imagined & non-human characters
    • Coarse collision detection
  • Motion Capture
    • Human figures
    • Subtle motions, long motions
  • Simulation
    • Passive simulations
    • When interactivity w/ motion is important

77

78 of 108

Integration of Technologies

  • Layering
    • Add hand/finger motion later
    • Facial animation
  • Use motion capture to drive simulation
  • Use keyframing to modify data
    • Fix missing sequences

78

Sian Lawson.

79 of 108

Layered humans

  • Sometimes just skin and bones doesn’t work
    • Use interior structures to help ‘shape’ the skin

80 of 108

Free form deformation

  • In order to model movement of the skin (or muscles)
    • Deform ‘neighborhood’ of vertices smoothly

81 of 108

Complex muscles

  • Some animations have been created by complex models of human muscles, skin, etc.

82 of 108

Combinations

83 of 108

The Art of animation

  • Illusion of Life
    • Emotion!!!
    • Principals of Traditional Animation applied to 3D Computer Graphics (John Lasseter)

Illusion of life

84 of 108

Principals of animation

  • Squash and stretch
    • When moving, real objects deform…

Illusion of life

85 of 108

Principals of Animation

  • Squash and stretch
    • Deform in direction of motion…
    • More then you’d expect in slow motion
    • videos

86 of 108

Principals of animation

  • Timing and motion
    • Timing gives meaning to movement

Scott McClouds “Making comics”

87 of 108

Principals of animation

  • Timing and motion
    • Timing gives meaning to movement
      • Head side to side
        • 1 in between character hit
        • 2 in between character has nervous twitch
        • 4 in between character gives snap order
        • 6 in between character watching tennis
        • 10 in between character stretching

88 of 108

Principals of animation

  • Timing can relate to material (mass)
    • videos

89 of 108

Principals of animation

  • Anticipation
    • Give the audience hints about what is next…
    • Perception of mass

Illusion of life

90 of 108

Principals of animation

  • Staging
    • Be able read scene
    • Silhouettes

91 of 108

Principals of animation

  • Follow through and overlapping action
    • Motion continues (hand after ball thrown)
    • Action does not completely stop before next starts

Illusion of life

92 of 108

Principals of animation

  • Straight ahead action and pose to pose
    • Straight ahead (hand drawn) �start -> finish (zany feel)
    • Pose to pose, �planned = key framing

Illusion of life

93 of 108

Principals of animation

  • Arcs
    • Most natural actions follow arcs

94 of 108

Principals of animation

  • Ease in and out
    • Start slow, reach speed, slow down, stop
    • video

95 of 108

Principals of animation

  • Secondary motion
    • Facial expression
    • appendages

96 of 108

Principals of animation

  • Exaggeration
    • Real but extreme

Illusion of life

97 of 108

Principals of animation

  • Appeal
    • Not necessarily kittens
    • asymmetry

98 of 108

Art in animation

  • Know your character and how they feel

99 of 108

Art in animation

  • acting and animation

100 of 108

Principals summary

  • Squash and stretch
  • Timing and motion
  • Anticipation
  • Staging
  • Follow through and overlapping action
  • Slow in and out
  • Arcs
  • Exaggeration
  • Secondary �action
  • Appeal

101 of 108

Perception (Bridson)

  • Apparent motion (what is this)…
  • Persistence of motion (what is this)…

102 of 108

Perception (Bridson)

  • Apparent motion (what is this)…

  • Persistence of motion (what is this)…

103 of 108

Perception (Bridson)

  • Why is motion blur important?

104 of 108

Perception (Bridson)

  • Why is motion blur important?

Jason and the Argonauts

105 of 108

Physics (Bridson)

  • Conservation of linear motion
    • Portray reactions�
  • Ballistic trajectories are arcs

  • Conserve volume

106 of 108

Pipeline (Bridson)

  • Storyboard and concept
  • Previz
  • Plate work
    • matting and camera matching
  • Modeling and rigging
  • Texturing

107 of 108

Pipeline (Bridson)

  • Layout
  • Animation
  • Effects
  • Lighting
  • Rendering
  • Compositing

108 of 108

Pipeline

  • Which of the stages of the pipeline are you going to use this quarter?