Lecture 08: Animation

download Lecture 08: Animation

If you can't read please download the document

description

Lecture 08: Animation. COMP 175: Computer Graphics March 4, 2014. Topics in Animation. Physics (dynamics, simulation, mechanics) Particles Rigid bodies (collisions, contact, etc.) Articulated bodies (constraints, robotics) Deformable bodies (fracture, cloth, elastic materials) - PowerPoint PPT Presentation

Transcript of Lecture 08: Animation

Introduction

Lecture 08:Animation

COMP 175: Computer GraphicsMarch 8, 2016COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationGo over the GL Matrix StackRecap on Camera and the GL Matrix StackCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationPhysics (dynamics, simulation, mechanics)ParticlesRigid bodies (collisions, contact, etc.)Articulated bodies (constraints, robotics)Deformable bodies (fracture, cloth, elastic materials)Natural phenomenon (fluid, water, fire, etc.)Character dynamics (motion, skin, muscle, hair, etc.)Character AnimationMotion captureMotion synthesis (locomotion, IK, procedural motion, retargeting)Motion playbackArtificial IntelligenceBehavioral animation Simulation of crowds (flocks, herds, crowds)Video game agentsCamera controlTopics in AnimationCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationTraditionally used in cel animationAnimator specifies the positions and orientations at various key pointsIn between frames are then interpolated. This used to be done by handNow this is mostly done by computersJohn Lasseter, SIGGRAPH 87, Principles of Traditional Animation Applied to 3D Computer Graphics

Key Framing

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationSplines are typically used to interpolate the positions of objectsInterpolating Key Frames

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationThe easiest spline to use is the cubic spline.http://www.cs.tufts.edu/comp/175/support/spline/

As the name suggests, cubic means an equation with a power of 3, which also means that we need 4 numbers to define the equationE.g., for a linear curve, y = ax + b, there are two unknowns (a and b), so we need two sets of equations. For quadratic function, y = ax^2 + bx + c, we will need three sets of equations, etc.

With key framing, how do we get a smooth curve between any two points?SplinesCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationCubic SplinesGeneral form of a cubic spline:q(t) = a + bt * ct^2 + dt^3q(t) = b + 2ct + 3dt^2Given:q(0) = S (starting point)q(0) = Vs (velocity at point S)q(1) = G (goal point)q(1) = Vg (velocity at end point G)COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationCubic SplinePlug in the numbers:q(0) = a + b(0) + c(0) + d(0) = S=> a = Sq(0) = b + 2c(0) + 3d(0) = Vs=> b = VsTwo remaining variables (c, d), two equations. Solve for c and d:q(1) = a + b(1) + c(1) + d(1) = Gq(1) = b + 2c + 3d = VgCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationCubic SplinePlug in a = S, and b = Vsq(1) = S + Vs + c + d = G ---- (eq1)q(1) = Vs + 2c + 3d = Vg ---- (eq2) Solve for c first, (eq1)*3 (eq2)=> c = -3S + 3G 2Vs 2VgSolve for d, (eq2) ((eq1) * 2)=> d = 2S 2G + Vs + VgCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationCubic SplinePutting it all together:q(t) = ( 1S + 0G + 0Vs + 0Vg) + ( 0S + 0G + 1Vs + 0Vg) * t + (-3S + 3G - 2Vs - 1Vg) * t * t + ( 2S - 2G + 1Vs + 1Vg) * t * t * t

Test this by plugging in t = 0 and t = 1

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationNote that the above equation solves for the cubic spline in one dimension, but you can generalize it to 3D.

This is because that since x, y, and z or orthogonal, we can compute the forces to x, y, and z independently.Splines in 3DCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationAnimators in the past didnt have access to computers, so they had to simulate what our eyes see when perceiving motion.These are known as stretch and squashGeneralized Motion

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationCartoon Physics

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationGenerating key frames continues to be an important question for animator because different effects require different techniquesHow to Obtain the Key Frames?

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationSkeletons and SkinningSkeletons: a collection of bones (rigid bodies) and jointsSkinning: associating each point of the mesh to an affine combination of bone/joint locationsReal-time deformation by applying skinning weights to deformed skeletonKey Framing in Character Animation

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationPopular in movies / games and supported by a wide range of software such as Maya, 3D Max.Skeletal Animation

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationForward Kinematics:Given a set of joint angles, what is the x,y,z position of my hand?This is basically your assignment 3 (and lab 3) with SceneGraphInverse Kinematics:Given the position of my hand, what is the pose (joint angles) of my character?Note that the solution might not be uniqueKinematics

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationIn a simple case: that is, 2D, two links, 1 fixed joint (can rotate by cant move), and 1 regular jointWe can solve for theta_knee using cos-1 because we know the length of link1 and link2. Given theta_knee, we can find betaSimple IK

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationIn more complex cases that involves multiple (hierarchical) joints, the problem is much more difficult.Again, this is partially because the solution space could be empty, or it could be large (i.e., solutions are not unique)The common solution is to use an iterative approximation algorithm (such as gradient descent, simulated annealing, etc.)Complex IKCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationThe general idea behind gradient descend method is based on the assumption that:Given a function f, you can quickly compute f(x) in gHowever, it is not easy to directly compute g(x)In addition, theres an error function that tells you how wrong you are (and sometimes in what directionality the error is that is, the gradient)So, gradient descent becomes iterative in that:The algorithm takes a random guess on xGiven the error feedback, compute a delta_xThen compute f(x + delta_x)And so onA Quick Reference to Gradient DescendCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationGiven an articulated figure, there are often constraints to the joints (e.g., how far they can bend)The iterative approach can integrate these constraints when looking for the solution xInverse Kinematics

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationDifferent technologies, but roughly categorized into two groups:Passive: passive systems are usually camera based. This means that an actor would wear reflective markers on a body suit, and cameras would capture and compute depth information. The benefits are that its easy to set up; can scale up to multiple actors; can be used on anything (such as faces or non-human actors). Downsides are: noise, occlusion, cost (in hardware and software), fixed environment (in the lab)Active: active systems do direct measurements of the joint angles. These include skeletal suits or flexors to measure forces. The benefits are almost exactly the opposite of the passive systemsMotion CaptureCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationPassive Systems

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationActive Systems

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationPractical Motion Capture in Everyday Surroundings by Vlasic et al., SIGGRAPH 07Hybrid

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationMotion capture labs are still largely very expensive to set up (depth cameras could cost hundreds of thousands)One approach to cut down the cost is to capture snippets of motions. For example, for a walk cycle, a gesture, etc.Given a sufficiently large motion library, one can generate a plausible motion graph by stitching these motion snippets togetherThe easy challenge is in blending the motions to hide the seamsThe hard challenge is to model intent Motion GraphsCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationHow would you blend motions?Motion Graph

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationThe idea of motion map sounds great, but there are still some big issues:

Motion captured data only works on a 3D model of the exact same (real) person.For example, think about how an infant (toddler, and troll) walks differently because of differences in body part proportions (http://research.cs.wisc.edu/graphics/Gallery/Retarget/final_render.htm)https://www.youtube.com/watch?v=Vn-vVzMGgec

And can we apply walking motion to, say, the Pixar Lamp? (Semantic Deformation Transfer -- http://www.mit.edu/~ibaran/sdt/)Motion RetargetingCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationIn addition to the retargeting issue, there is also the problem of coverage. Namely, what happens if there is a missing chunk of animation that you need but it isnt in the library/database?

http://www.cs.cmu.edu/~aw/pdf/spacetime.pdfhttp://www.cs.cmu.edu/~aw/mpg/luxo.mpghttp://graphics.cs.cmu.edu/nsp/papers/sig97.pdfhttp://graphics.cs.cmu.edu/nsp/projects/spacetime/spacetime.htmlMotion SynthesisCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationPlausible Motion Simulation for Computer Graphics Animation, Barzel et al., SIGGRAPH 96http://www.ronenbarzel.org/papers/plausible/

Perceptual Metrics for Character Animation, Reitsma et all, SIGGRAPH 02http://graphics.cs.cmu.edu/nsp/projects/perception/perception.htmlPerception of MotionCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationRotations and Quaternions COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationGeneralized MotionCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationThis is kind of a fancy way of saying f = ma, but still has the problem of needing to work with the linear forces and the rotational forces (torque) separately.

Thankfully, we can put the two together in one package in matrix form.Generalized MotionCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationGeneralized ForcesCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationGoing back to the Generalized FormCOMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationExample

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 AnimationRigid BodiesFast collision detectionTransference of forcesFast computation for large number of objectsDeformable BodiesNatural phenomenonhttp://physbam.stanford.edu/~fedkiw/http://www.youtube.com/watch?v=nJWz0PaMlkI

Physically Based Simulation

COMP 175 | COMPUTER GRAPHICSRemco Chang#/3708 Animation