1cs426-winter-2008 Notes SIGGRAPH crunch time - my apologies :-)
2cs426-winter-2008 IK issues 2 Target impossible (or just barely possible) --- not enough degrees of freedom Try to get as close as possible to the target in some sense Also penalize bad joint angles, huge differences from initial pose So if pose is only just possible, via some weird unrealistic angles, we don’t do it
3cs426-winter-2008 How do you do IK? Simple skeletons: analytic solutions may exist Look up formulas from papers Not fun, not flexible More generally: numerical solution of optimization problem Minimize difference between actual end- effector pose and the target Possibly include constraints E.g. joint angle limits, collisions Possibly penalize awkward or jerky poses
4cs426-winter-2008 IK as optimization Unconstrained optimization problem: In our case: theta is a vector of all the joint angles f(.) is a measure of the distance between the pose of the end-effector and the target (plus optionally penalty term on bad poses) Start from an initial guess, use algorithms to steadily make better guesses until close enough
5cs426-winter-2008 Line Search Approach Say we have guess k Pick a “direction” d k to search along Look for new guess as k+1 = k + d k Line search: figure out a scalar (the “step size”) that will make f( k+1 ) smaller than f( k ) Assuming d k is scaled properly, simplest algorithm: Check =1: if it’s an improvement stop Otherwise halve and try again If d k is “downhill” d k f<0 then guaranteed to improve if is small enough
6cs426-winter-2008 Picking the direction Cyclic Coordinate Descent: in each direction, pick a different axis to move along (adjust just one angle at a time) Problem 1: scaling isn’t clear Problem 2: extremely inefficient, might not converge at all Steepest Descent: use the direction that f(.) is decreasing most rapidly in: - f Problem 1: scaling isn’t clear Problem 2: inefficient for difficult f
7cs426-winter-2008 More on Steepest Descent Typically we have a nonlinear least-squares problem: In this case, - f=J T (x target -x( )) where J=∂x/∂ is the Jacobian Then sometimes this is called the “Jacobian method”
8cs426-winter-2008 Gauss-Newton Can approximate the nonlinear term with a linear function (Taylor series with the Jacobian!) and get a linear least squares problem: Gauss-Newton Much more efficient, though we need to solve a (small) linear system to get the direction
9cs426-winter-2008 Evaluating Jacobians Simplest approach in code: numerically approximate with a finite difference Can also work out derivative analytically by hand (a little painful)
10cs426-winter-2008 When to stop In our case, absolute minimum of f(.) is zero: stop when it’s smaller than some tolerance It might be impossible to get to zero, but at the minimum f=0: stop when | f| is small enough Or give up when maximum number of iterations reached
11cs426-winter-2008 Character Rigging A “rig” is a model together with a UI for posing it At its simplest, a skeleton with joint angles available for motion curves May simplify DOF by enforcing relationships between joints E.g. hand and fingers May define standard poses (especially for facial expressions!) that can be mixed together Then can set sliders to, say, 70% happy, 20% surprised, … Take weighted linear combination of pose angles
12cs426-winter-2008 What’s left? We now have the basics of animation Plan for rest of course: Rendering animations (Semi-)automatic animation Dynamics for rigid bodies Particle systems Skinning, morphing, blending Motion capture Motion control