• No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Computer Animation IIWen-Chieh (Steve) LinNational Chiao-Tung UniversityShirley, Fundamentals of Computer Graphics, Chap 16Doug James CG slides

A Hierarchy of Animation ProcessesVery High-Level ScriptingBehaviors Performance-Based KinematicsPhysics/DynamicsProceduralCharacter AnimationKeyframingCompletely ManualDCP4516 Introduction to Computer Graphics 2

Animation Techniques•Keyframing•Character animation•Procedural animation•Physics-based animationDCP4516 Introduction to Computer Graphics 3

Keyframing: Motion Control•Specifies how fast an object moves between keypositions: p(t) = p(u(s(t)))–p(u): space curve–s(t): arc length along the space curve–u(s): additional function that computes a parametervalue u for given arc length sDCP4516 Introduction to Computer Graphics 4

Computing Arc length•Analytic form for u=s -1 (L) usually doesn’t222existuL s( u)x( v)v•Compute an arc lengthtable instead!0p( u)(x(u),y(u),z(u))y( v)vz( v)vdvsi( u ) ipjpj1 s( ui1) pipi1j1DCP4516 Introduction to Computer Graphics 5

Motion Control: p(t) = p(u(s(t)))Arc Length Tableus(u) CurveP( u* )u**……DCP4516 Introduction to Computer Graphics 6t*

Ease-in Ease-out•Assume that the motion starts and stops atthe beginning and end of the motion curveArc length(distance)TimeEqually spaced samples in time specify arc length required for that frameDCP4516 Introduction to Computer Graphics 7

Animation Techniques•Keyframing•Character animation•Procedural animation•Physics-based animationDCP4516 Introduction to Computer Graphics 8

Hierarchical Articulated Model•Represent an articulated figure as a series of linksconnected by joints•Enforce limb connectivity in a tree-like structurerootDCP4516 Introduction to Computer Graphics 9

Making an Articulated Modelr Ap B q•A minimal 2-D jointed object:–Two pieces, A (“forearm”) and B (“upper arm”)–Attach point q on B to point r on A (“elbow”)–Desired control knobs:•o: shoulder position (point at which p winds up)•u: shoulder angle (A and B rotate together about p)•v: elbow angle (A rotates about r, which stays attachedto q)DCP4516 Introduction to Computer Graphics 10pBqrA

Making an Arm, step 1arA•Start with A and B in their untransformedconfigurations (B is hiding behind A)•First apply a series of transformations to A,leaving B where it is…DCP4516 Introduction to Computer Graphics 11

Making an Arm, step 2T(-r)arArBpAq•Translate by -r, bringing r to the origin•You can now see B peeking out frombehind ADCP4516 Introduction to Computer Graphics 12

Making an Arm, step 3R(v)T(-r)arBpAqrp B qA•Next, we rotate A by v (the “elbow”angle)DCP4516 Introduction to Computer Graphics 13

Making an Arm, step 4T(q)R(v)T(-r)arp B qADCP4516 Introduction to Computer Graphics 14p B q•Translate A by q, bringing r and q together to formthe elbow joint•We can regard q as the origin of the lower armcoordinate system, and regard A as being in thiscoordinate system.rA

Making an Arm, step 5T(-p)T(q)R(v)T(-r)ap B qrADCP4516 Introduction to Computer Graphics 15T(-p)bp B q•From now on, each transformation applies toboth A and B (This is important!)•First, translate by -p, bringing p to the origin•A and B both move together, so the elbowdoesn’t separate!rA

Making an Arm, step 6R(-u)T(-p)T(q)R(v)T(-r)ap B qrAR(-u)T(-p)bp B-u•Then, we rotate by -u, the“shoulder”anglerA•Again, A and B rotatetogetherDCP4516 Introduction to Computer Graphics 16

Making an Arm, step 7T(o)R(-u)T(-p)T(q)R(v)T(-r)ap B qrAT(o)R(-u)T(-p)bp B qrA•Finally, translate by o,bringing the arm where wewant it•p is at origin of upper armcoordinate systemDCP4516 Introduction to Computer Graphics 17

So What Have We Done?•Seems more complicated than just translating androtating each piece separately•But the model is easy to modify/animate:–Remember the transformation sequence, and the parametersyou used—they’re part of the model.–Whenever the parameters change, reapply all of thetransformations and draw the result•The model will not fall apart!!!•Note:–u, v, and o are parameters of the model.–but p, q, and r are structural constants.–Changing u, v, or o wiggles the arm–Changing p, q, or r dismembers it (useful only in video games!)DCP4516 Introduction to Computer Graphics 18

Transformation HierarchiesTrans oRot -u -uTrans -p -pT(o)R(-u)T(-p)T(q)R(v)T(-r)a•This is the build-an-armsequence, represented as a tree•Interpretation:–Leaves are geometric primitivesTrans qRot vTrans -r -rAABBControl KnobPrimitiveStructural–Internal nodes are transformations–Transformations apply to everythingunder them—start at the bottom andwork your way up•You can build a wide range ofmodels this wayDCP4516 Introduction to Computer Graphics 19

A Schematic Humanoidl. l. arm2torsoshoulderl. l. arm1 r. r. arm1r. r. arm2hipl. l. leg1l. l. leg2neckheadr. r. leg1r. r. leg 2•Each node represents–rotation(s)–geometric primitive(s)–struct. transformations•The root can beanywhere. We chosethe hip (can re-root)•Control knob for eachjoint angle, plus globalposition and orientation•A realistic human wouldbe much more complexDCP4516 Introduction to Computer Graphics 21

Directed Acyclic Graphl. l. arm2torsoshoulderl. l. arm1 r. r. arm1r. r. arm2hipl. l. leg1l. l. leg2neckheadr. r. leg1r. r. leg 2This is a graph, so youcan re-root it (makehead the root)It’s directed, renderingtraversal only followslinks one way.It’s acyclic, to avoidinfinite loops inrendering.DCP4516 Introduction to Computer Graphics 22

What Hierarchies Can and Can’t Do•Advantages:–Reasonable control knobs–Maintains structural constraints•Disadvantages:–Doesn’t always give the “right”control knobs trivially•e.g. hand or foot position - re-rooting may help–Can’t do closed kinematic chains easily (keep hand on hip)–Missing other constraints: do not walk through walls•Hierarchies are a vital tool for modeling andanimationDCP4516 Introduction to Computer Graphics 23

Joint Space vs. Cartesian Space•Joint space–space formed by joint angles–position all joints—fine level control•Cartesian space–3D space–specify environment interactionsDCP4516 Introduction to Computer Graphics 24

Forward and Inverse Kinematics•Forward kinematics–mapping from joint space to cartesian space•Inverse kinematics–mapping from cartesian space to joint space 1PP 2Forward KinematicsP f 1, )(2DCP4516 Introduction to Computer Graphics 25Inverse Kinematics1, f ( )1 2P

Forward & Inverse Kinematics (cont.)•Forward kinematics–good for rendering•Inverse kinematics–good for specifying environment interaction–good for controlling a character—fewer parametersDCP4516 Introduction to Computer Graphics 26

Motion Capture•Record the animation from live action– simplest method - rotoscope (trace) over video of real motions•Real time input devices– electronic puppeteering•Motion capture– track motion of reference points•body or face or hands– magnetic– optical– exoskeletons– convert to joint angles (not always straightforward)– use these angles to drive an articulated 3-D model– These motion paths can be warpedDCP4516 Introduction to Computer Graphics 27

Motion CaptureDCP4516 Introduction to Computer Graphics 28

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!