CS559: Computer Graphics Lecture 36: Animation Li Zhang Spring 2008 Many slides from James Kuffner’s graphics class at CMU.

Slides:



Advertisements
Similar presentations
Kinetics of Particles Impulse and Momentum.
Advertisements

Dr. Midori Kitagawa University of Texas at Dallas Arts and Technology Program.
Net Force.
12 Principle of Animation. Series of pictures of objects/characters in motion Displayed at some rate –film 24 fps –video 30 fps What is animation?
1Notes. 2 Triangle intersection  Many, many ways to do this  Most robust (and one of the fastest) is to do it based on determinants  For vectors a,b,c.
MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Week 2 : Dynamics & Numerical Methods Goal : To write a simple physics simulation Topics: Intro.
Linear dynamic systems
Graphics Korea University Computer Animation Computer Graphics.
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 24: Animation Many slides courtesy Adam Finkelstein,
UNC Chapel Hill S. Redon - M. C. Lin Rigid body dynamics II Solving the dynamics problems.
1cs533d-term Notes  list Even if you’re just auditing!
1cs533d-term Notes  Typo in test.rib --- fixed on the web now (PointsPolygon --> PointsPolygons)
Linear Momentum Lecturer: Professor Stephen T. Thornton
UNC Chapel Hill M. C. Lin Review Particle Dynamics (see transparencies in class)
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Introduction to Modeling Fluid Dynamics 1.
Nine Old Men Disney’s Nine Old Men were the main animators that created Disney’s most famous animated films from Snow White to The Rescuers. They were.
CS 4730 Physical Simulation CS 4730 – Computer Game Design.
Feature-length films: Games: Desktop Animations: Computer Animation.
05/09/02(c) 2002 University of Wisconsin Last Time Global illumination algorithms Grades so far.
Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Animation Vladimir Savchenko
Momentum. NEWTON’S LAWS Newton’s laws are relations between motions of bodies and the forces acting on them. –First law: a body at rest remains at rest,
John Lasseter 1987 PRINCIPLES OF TRADITIONAL ANIMATION APPLIED TO 3D COMPUTER ANIMATION.
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
CSC418 Computer Graphics n Animation Principles n Keyframe Animation.
Physically Based Modeling Let physics take over!.
3D Graphics for Game Programming Chapter XII Physics-based Simulation.
Computer Graphics 2 In the name of God. Outline Introduction Animation The most important senior groups Animation techniques Summary Walking, running,…examples.
Numerical Integration and Rigid Body Dynamics for Potential Field Planners David Johnson.
Large Steps in Cloth Simulation - SIGGRAPH 98 박 강 수박 강 수.
Forces 1 Forces 2 Friction 3 Forces and Equilibrium.
Animation Basics. A) Animation In animation we attempt to make things that aren’t really there appear as though they could actually exist and move in.
Lecture Fall 2001 Physically Based Animation Ordinary Differential Equations Particle Dynamics Rigid-Body Dynamics Collisions.
Forces and Motion PS C-5.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
Graphics Graphics Korea University cgvr.korea.ac.kr 1 Computer Animation 고려대학교 컴퓨터 그래픽스 연구실.
University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell Particle Systems.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Physics for Games Spring 2012.
Animation & 3D Animation
CS559: Computer Graphics Lecture 36: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
Chapter 4 The Laws of Motion. Classical Mechanics Describes the relationship between the motion of objects in our everyday world and the forces acting.
12 Principles Of Animation (1)Squash and Stretch (2)Anticipation (3)Staging (4)Straight Ahead Action and Pose to Pose (5)Follow Through and Overlapping.
UNC Chapel Hill M. C. Lin Basics of Motion Generation let X i = position,orient. of O i at t k = t 0,  i END = false while (not END) do display O i, 
Module 10Energy1 Module 10 Energy We start this module by looking at another collision in our two inertial frames. Last time we considered a perfectly.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
More on Particles Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, March 24, 2004.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Chapter Five: Force  5.1 Forces  5.2 Friction  5.3 Forces and Equilibrium.
Animation Animation is about bringing things to life Technically: –Generate a sequence of images that, when played one after the other, make things move.
CS559: Computer Graphics Lecture 27: Animation, Depth & Motion Blur, Ray Tracing Li Zhang Spring 2010 Slides from Brian Curless at U of Washington.
Get your software working before putting it on the robot!
Feature-length films: Games: Desktop Animations:.
CS559: Computer Graphics Lecture 26: Animation Li Zhang Spring 2010 Slides from Brian Curless at U of Washington.
Presented By: V. Jagadeesh (59) Animation The word “animation” is a form of “animate,” which means to bring to life to object. Thus when a multimedia.
Advanced Computer Graphics Rigid Body Simulation
Computer Animation cgvr.korea.ac.kr.
Manipulator Dynamics 1 Instructor: Jacob Rosen
Lecture 36: Animation Li Zhang Spring 2008
Lecture 36: Animation Li Zhang Spring 2008
Review Particle Dynamics (see transparencies in class) UNC Chapel Hill
Review ODE Basics Particle Dynamics (see transparencies in class)
Review ODE Basics Particle Dynamics (see transparencies in class)
(c) 2002 University of Wisconsin
Computer Animation Algorithms and Techniques
12 Principles of Animation
Net Force.
Review ODE Basics Particle Dynamics (see transparencies in class)
GPAT – Chapter 7 Physics.
Presentation transcript:

CS559: Computer Graphics Lecture 36: Animation Li Zhang Spring 2008 Many slides from James Kuffner’s graphics class at CMU

Today Traditional Animation, Computer Animation Reading (Optional) Shirley, ch 16, overview of animation

Animation Traditional Animation – without using a computer

Animation Computer Animation

Types of Animation Cartoon Animation

Types of Animation Cartoon Animation Key Frame Animation

Types of Animation Cartoon Animation Key Frame Animation Physics based animation Nguyen, D., Fedkiw, R. and Jensen, H., "Physically Based Modeling and Animation of Fire", SIGGRAPH 2002

Types of Animation Cartoon Animation Key Frame Animation Physics based animation Enright, D., Marschner, S. and Fedkiw, R., "Animation and Rendering of Complex Water Surfaces", SIGGRAPH 2002

Types of Animation Cartoon Animation Key Frame Animation Physics based animation Data driven animation

Types of Animation Cartoon Animation Key Frame Animation Physics based animation Data driven animation

Types of Animation Cartoon Animation Key Frame Animation Physics based animation Data driven animation

Types of Animation Cartoon Animation Key Frame Animation Physics based animation Data driven animation

Principles of Animation John Lasseter. Principles of traditional animation applied to 3D computer animation. Proceedings of SIGGRAPH (Computer Graphics) 21(4): 35-44, July Goal : make characters that move in a convincing way to communicate personality and mood. Walt Disney developed a number of principles. – ~1930 Computer graphics animators have adapted them to 3D animation.

Principles of Animation The following are a set of principles to keep in mind: 1. Squash and stretch 2. Staging 3. Timing 4. Anticipation 5. Follow through 6. Overlapping action 7. Secondary action 8. Straight-ahead vs. pose-to-pose vs. blocking 9. Arcs 10. Slow in, slow out 11. Exaggeration 12. Appeal

Squash and stretch Squash: flatten an object or character by pressure or by its own power. Stretch: used to increase the sense of speed and emphasize the squash by contrast. Note: keep volume constant! animation/principles/squash_and_stretch.htm animation/principles/squash_and_stretch.htm animation/principles/bouncing_ball_example_of_slow_in_out.htm animation/principles/bouncing_ball_example_of_slow_in_out.htm

Squash and stretch (cont’d)

Anticipation An action has three parts: anticipation, action, reaction. Anatomical motivation: a muscle must extend before it can contract. Prepares audience for action so they know what to expect. Directs audience's attention. Watch: bugs-bunny.virtualdub.new.mpg

Anticipation (cont’d) Amount of anticipation (combined with timing) can affect perception of speed or weight.

Arcs Avoid straight lines since most things in nature move in arcs.

Slow in and slow out An extreme pose can be emphasized by slowing down as you get to it (and as you leave it). In practice, many things do not move abruptly but start and stop gradually.

Exaggeration Get to the heart of the idea and emphasize it so the audience can see it.

Exaggeration Get to the heart of the idea and emphasize it so the audience can see it.

Appeal The character must interest the viewer. It doesn't have to be cute and cuddly. Design, simplicity, behavior all affect appeal. Example: Luxo, Jr. is made to appear childlike.

Appeal (cont’d) Note: avoid perfect symmetries.

Appeal (cont’d) Note: avoid perfect symmetries.

Particle Systems

What are particle systems? A particle system is a collection of point masses that obeys some physical laws (e.g, gravity, heat convection, spring behaviors, …). Particle systems can be used to simulate all sorts of physical phenomena:

Particle in a flow field We begin with a single particle with: – Position, – Velocity, Suppose the velocity is actually dictated by some driving function g: x g(x,t) x y

Vector fields At any moment in time, the function g defines a vector field over x: How does our particle move through the vector field?

Diff eqs and integral curves The equation is actually a first order differential equation. We can solve for x through time by starting at an initial point and stepping along the vector field: This is called an intial value problem and the solution is called an integral curve. Start Here

Euler’s method One simple approach is to choose a time step,  t, and take linear steps along the flow: Writing as a time iteration: This approach is called Euler’s method and looks like: Properties: – Simplest numerical method – Bigger steps, bigger errors. Error ~ O(  t 2 ). Need to take pretty small steps, so not very efficient. Better (more complicated) methods exist, e.g., “Runge-Kutta” and “implicit integration.”

Particle in a force field Now consider a particle in a force field f. In this case, the particle has: – Mass, m – Acceleration, The particle obeys Newton’s law: The force field f can in general depend on the position and velocity of the particle as well as time. Thus, with some rearrangement, we end up with:

This equation: is a second order differential equation. Our solution method, though, worked on first order differential equations. We can rewrite this as: where we have added a new variable v to get a pair of coupled first order equations. Second order equations

Phase space Concatenate x and v to make a 6-vector: position in phase space. Taking the time derivative: another 6-vector. A vanilla 1 st -order differential equation.

Differential equation solver Applying Euler’s method: Again, performs poorly for large  t. And making substitutions: Writing this as an iteration, we have: Starting with:

Particle structure position velocity force accumulator mass Position in phase space How do we represent a particle?

Single particle solver interface getDim derivEval getState setState

Particle systems particles ntime In general, we have a particle system consisting of n particles to be managed over time:

Particle system solver interface particles ntime derivEval get/setState getDim For n particles, the solver interface now looks like:

Particle system diff. eq. solver We can solve the evolution of a particle system again using the Euler method:

Forces Each particle can experience a force which sends it on its merry way. Where do these forces come from? Some examples: – Constant (gravity) – Position/time dependent (force fields) – Velocity-dependent (drag) – N-ary (springs) How do we compute the net force on a particle?

Particle systems with forces particles ntime forces F2F2 F nf nf Force objects are black boxes that point to the particles they influence and add in their contributions. We can now visualize the particle system with force objects: F1F1

Gravity and viscous drag p->f += p->m * F->G p->f -= F->k * p->v The force due to gravity is simply: Often, we want to slow things down with viscous drag:

A spring is a simple examples of an “N-ary” force. Recall the equation for the force due to a spring: We can augment this with damping: The resulting force equations become: Note: stiff spring systems can be very unstable under Euler integration. Simple solutions include heavy damping (may not look good), tiny time steps (slow), or better integration (Runge-Kutta is straightforward). Damped spring r = rest length

derivEval 1.Clear forces Loop over particles, zero force accumulators 2.Calculate forces Sum all forces into accumulators 3.Return derivatives Loop over particles, return v and f/m Apply forces to particles Clear force accumulators Return derivatives to solver F2F2 F3F3 F nf F1F1

Bouncing off the walls Handling collisions is a useful add-on for a particle simulator. For now, we’ll just consider simple point-plane collisions. A plane is fully specified by any point P on the plane and its normal N. N P v x

Collision Detection How do you decide when you’ve made exact contact with the plane? N P v x

Normal and tangential velocity To compute the collision response, we need to consider the normal and tangential components of a particle’s velocity. N P v x v

Collision Response before after v’v’ The response to collision is then to immediately replace the current velocity with a new velocity: The particle will then move according to this velocity in the next timestep. v

Collision without contact In general, we don’t sample moments in time when particles are in exact contact with the surface. There are a variety of ways to deal with this problem. The most expensive is backtracking: determine if a collision must have occurred, and then roll back the simulation to the moment of contact. A simple alternative is to determine if a collision must have occurred in the past, and then pretend that you’re currently in exact contact.

Very simple collision response How do you decide when you’ve had a collision? A problem with this approach is that particles will disappear under the surface. We can reduce this problem by essentially offsetting the surface: Also, the response may not be enough to bring a particle to the other side of a wall In that case, detection should include a velocity check: N P v1v1 x1x1 x2x2 x3x3 v2v2 v3v3

More complicated collision response Another solution is to modify the update scheme to: – detect the future time and point of collision – reflect the particle within the time-step N P v x

Particle frame of reference Let’s say we had our robot arm example and we wanted to launch particles from its tip. How would we go about starting the particles from the right place? First, we have to look at the coordinate systems in the OpenGL pipeline…

The OpenGL geometry pipeline

Projection and modelview matrices Any piece of geometry will get transformed by a sequence of matrices before drawing: p’= M project M view M model p The first matrix is OpenGL’s GL_PROJECTION matrix. The second two matrices, taken as a product, are maintained on OpenGL’s GL_MODELVIEW stack: M modelview = M view M model

Robot arm code, revisited Recall that the code for the robot arm looked something like: glRotatef( theta, 0.0, 1.0, 0.0 ); base(h1); glTranslatef( 0.0, h1, 0.0 ); glRotatef( phi, 0.0, 0.0, 1.0 ); upper_arm(h2); glTranslatef( 0.0, h2, 0.0 ); glRotatef( psi, 0.0, 0.0, 1.0 ); lower_arm(h3); All of the GL calls here modify the modelview matrix. Note that even before these calls are made, the modelview matrix has been modified by the viewing transformation, M view.

Computing the particle launch point To find the world coordinate position of the end of the robot arm, you need to follow a series of steps: 1. Figure out what M view is before drawing your model. 2.Draw your model and add one more transformation to the tip of the robot arm. glTranslatef( 0.0, h3, 0.0 ); 3. Compute 4. Transform a point at the origin by the resulting matrix. Now you’re ready to launch a particle from that last computed point! Vec3f particleOrigin = particleXform * Vec3f(0,0,0); Mat4f particleXform = getWorldXform(matCam); Mat4f matCam = glGetModelViewMatrix();

Types of Animation Easier to render, 3d model, and mocap, physical simulation

Timing Lip sync?

Character animation FK? IK?