Download presentation
Presentation is loading. Please wait.
Published byLizbeth Patrick Modified over 9 years ago
1
CNM 190 Advanced Digital Animation Lec 10 : Inverse Kinematics & Automating Animation Dan Garcia, EECS (co-instructor) Greg Niemeyer, Art (co-instructor) Jeremy Huddleston, EECS (TA) A ski-jumping Luxo, Jr. from Spacetime Constraints, 1988
2
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 2/12Inverse Kinematics & Automating Animation Overview Dan Forward vs Inverse Kinematics Forward vs Inverse Kinematics Automating Animation Automating Animation Short film study Short film study Bounding Bounding Mike’s new car Mike’s new car For the Birds For the Birds In the Rough In the RoughJeremy Demo of Mel tools for Demo of Mel tools for Importing data Importing data Creating UI elements Creating UI elements
3
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 3/12Inverse Kinematics & Automating Animation Background You Know Already 3D rigid model 3D rigid model Usually given in “da Vinci” or “relaxed bind” pose Usually given in “da Vinci” or “relaxed bind” pose Rigging Rigging Designing a hierarchical skeleton Designing a hierarchical skeleton Use fewest joints as possible! Use fewest joints as possible! Binding Binding Connecting the character’s geometry to its skeleton Connecting the character’s geometry to its skeleton Animation Animation Moving skeleton moves character due to binding Moving skeleton moves character due to binding How to animate? How to animate?
4
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 4/12Inverse Kinematics & Automating Animation Forward vs Inverse Kinematics Forward Kinematics Forward Kinematics (x,y,z) (x,y,z) Rotate top-level joints and the children joints follow automatically Rotate top-level joints and the children joints follow automatically No ambiguity No ambiguity Inverse Kinematics Inverse Kinematics (x,y,z) (x,y,z) Position the end joints and the inner joints bend to compensate Position the end joints and the inner joints bend to compensate Usu lots of solutions! Usu lots of solutions! (x,y,z)-space -space FK IK
5
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 5/12Inverse Kinematics & Automating Animation How Does IK Work? You are at point P 0 in N-dim joint space You are at point P 0 in N-dim joint space You’re asked to move to (x,y,z,…) point P 1 You’re asked to move to (x,y,z,…) point P 1 It’s not clear what values of yield that (x,y,z,…) It’s not clear what values of yield that (x,y,z,…) How do we get there? How do we get there? Answer: IK Solver Answer: IK Solver Any algorithm for doing this successfully Any algorithm for doing this successfully Must factor in torques, dead spaces due to constraints, total energy Must factor in torques, dead spaces due to constraints, total energy P0P0P0P0 P1P1P1P1
6
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 6/12Inverse Kinematics & Automating Animation Let’s Look at a 2D Example (1) Two-jointed, robot arm with red target Two-jointed, robot arm with red target We can measure how close we are at any point (from a,b->x,y) We can measure how close we are at any point (from a,b->x,y) If we did this for all a,b angles, we’d get the graph to the right If we did this for all a,b angles, we’d get the graph to the right Brightness is distance to the red goal Brightness is distance to the red goal We only know answer locally -- we search! We only know answer locally -- we search! freespace.virgin.net/hugo.elias/models/m_ik2.htm a b
7
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 7/12Inverse Kinematics & Automating Animation Let’s Look at a 2D Example (2) Two-jointed robot arm with red goal target Two-jointed robot arm with red goal target Rotating joint A moves the tip in a direction Rotating joint A moves the tip in a direction This gets us closer to the solution This gets us closer to the solution Rotating joint B moves the tip in b direction Rotating joint B moves the tip in b direction Here, this is of no use Here, this is of no use Most joints can rotate both clockwise and counter- clockwise Most joints can rotate both clockwise and counter- clockwise After a rotates a bit, we need to reverse-rotate b to extend After a rotates a bit, we need to reverse-rotate b to extend We do this entire process incrementally, with small a, b We do this entire process incrementally, with small a, b freespace.virgin.net/hugo.elias/models/m_ik2.htm
8
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 8/12Inverse Kinematics & Automating Animation Let’s Look at a 2D Example (3) Graph below shows error (distance to target) with contour equal value lines Graph below shows error (distance to target) with contour equal value lines We examine local gradient We examine local gradient Which direction leads us fastest downhill? Go there! Which direction leads us fastest downhill? Go there! “Simple Gradient Following”, also known as “greedy” “Simple Gradient Following”, also known as “greedy” Do this over and over until you can’t go anymore Do this over and over until you can’t go anymore When you stop, either you’re When you stop, either you’re There, and you’re done! There, and you’re done! Not there, and you’ve reached Not there, and you’ve reached A local minimum A local minimum A constraint-based minimum A constraint-based minimum freespace.virgin.net/hugo.elias/models/m_ik2.htm Pose P
9
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 9/12Inverse Kinematics & Automating Animation Let’s Look at a 2D Example (4) Two ways to calculate gradient: Two ways to calculate gradient: By measurement (move, calc) By measurement (move, calc) By calculation (thanks, Newton) By calculation (thanks, Newton) freespace.virgin.net/hugo.elias/models/m_ik2.htm for each joint if 3D: axis = axis of rotation for this joint if 2D: axis = (0, 0, 1) ToTip = tip - joint_centre ToTarget = target - tip movement_vector = crossproduct(ToTip, axis) gradient = dotproduct(movement_vector, ToTarget) end loop
10
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 10/12Inverse Kinematics & Automating Animation Let’s Look at a 3D Example You don’t need to always specify a fixed point in space for your end joint. You don’t need to always specify a fixed point in space for your end joint. Alternatively, you could specify another locus of points and move to the closest point on the surface Alternatively, you could specify another locus of points and move to the closest point on the surface freespace.virgin.net/hugo.elias/models/m_ik2.htm
11
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 11/12Inverse Kinematics & Automating Animation When to use FK vs IK? FK Can control the rotation of a single joint and lock others Can control the rotation of a single joint and lock others No unexpected elbow/knee flipping No unexpected elbow/knee flipping Natural “arcs” by default Natural “arcs” by default Works with multi- joints as expected Works with multi- joints as expectedIK Only need to move a single object to pose Only need to move a single object to pose Can lock down an end effector (like wrist or ankle) while rest of body moves Can lock down an end effector (like wrist or ankle) while rest of body moves Good w/2-joint chains Good w/2-joint chains Great for legs! Great for legs!
12
http://inst.eecs.berkeley.edu/~selfpace/ CNM19 0 12/12Inverse Kinematics & Automating Animation Automating Animation Delightful SIGGRAPH 1988 paper entitled: “Spacetime Constraints” Delightful SIGGRAPH 1988 paper entitled: “Spacetime Constraints” Set up a system with real physics (torques, gravity) Set up a system with real physics (torques, gravity) …with space AND time as part of the object’s pose …with space AND time as part of the object’s pose Let the system try to figure out how to optimize Let the system try to figure out how to optimize Automatic animation! Automatic animation! Very powerful idea, could use it in Olympic training simulation Very powerful idea, could use it in Olympic training simulation
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.