1 / 28

Computer Animation Algorithms and Techniques

Computer Animation Algorithms and Techniques. Optimization & Constraints. Add mention of global techiques. Add mention of calculus of variations. Enforcing Soft and Hard Constraints. Soft constraints - Minimizing energy terms Hard constraints – constrained optimization

derica
Télécharger la présentation

Computer Animation Algorithms and Techniques

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Computer AnimationAlgorithms and Techniques Optimization & Constraints Add mention of global techiques Add mention of calculus of variations

  2. Enforcing Soft and Hard Constraints Soft constraints - Minimizing energy terms Hard constraints – constrained optimization Example: Space-time constraints

  3. Constrained optimization Use whenever the best, shortest, least error, is needed: Fit surface with least curvature to set of points Reach for object with minumu torque Find motion in database whose start pose is closest to end of current motion

  4. Minimum (or maximum) of a function f(x) Ballistic motion f’(x) = 0 Analytic derivative & solution

  5. Minimum (or maximum) of a function Multivariate case Gradient / Jacobian

  6. Energy function Define energy terms in terms of geometric features =0 for desirable configuration increases for less desirable configurations Useful geometric features– easy to compute Parametric position function P(u,v) Surface normal function, N(u,v) Implicit function I(x) – distance to surface Search parameter space modify parameters to reduce energy

  7. Useful Constraints

  8. Pipe assembly

  9. Finding the minimum minimize Analytic derivative/gradient Numeric approximation to derivative/gradient Analytic solution Numeric solution by iterative search Newton’s method Steepest Descent Conjugate Gradient Method

  10. Newton’s method

  11. Steepest descent – step in direction of negative of gradient

  12. Conjugate gradient method

  13. Constrained Optimization minimize Equality constraints Inequality constraints

  14. Lagrange multipliers .

  15. Spacetime constraints http://www.cs.cmu.edu/~aw/pdf/spacetime.pdf Constrained optimization problem in time and space Constraints – e.g. locating certain points in time and space Non penetration constraints Objective function – e.g. Minimize the amount of force used over time interval Minimize maximum torque.

  16. Spacetime constraint example Particle position is function of time, x(t) Time-varying force function, f(t) Equation of motion Given f(t), x(t0), - integrate to get x(t).

  17. Spacetime constraint example Need to determine f(t) x(t0) = a x(t1) = b Subject to constraints Objective: to minimize total force Objective function:

  18. Spacetime constraint example Use discrete x(t), f(t), R, constraints Time derivatives approximated by finite differences Constraints: R – minimize discrete version subject to constraints.

  19. Spacetime constraint canonical form Numerical Solution – canonical form Sj – collection of scalar independent variables x, y, z components of the xi’s and fi’s R(Sj) – objective function to be minimized sum of forces squared used at each time step Ci (Sj) – collection of scalar constraint functions => 0. components of pi’s, ca, and cb .

  20. Spacetime constraint - canonical Numerical problem statement Find Sj that minimizes R(Sj) subject to Ci(Sj) = 0 • Numerical solution method: • Request values of R and Ci for given Sj • Access to derivatives of R and Ci with respect to Sj • Iteratively provides updated values for solution vector Sj .

  21. Spacetime constraint Sequential Quadratic Programming (SQP) Computes second-order Newton-Raphson step in R Computes first-order Newton-Raphson step in the Ci’s Projects the first onto the null space of the second to the hyperplane for which all the Ci’s are constant to the first order.

  22. Spacetime constraint using SQP Sequential Quadratic Programming (SQP) Computes second-order Newton-Raphson step in R Hessian Computes first-order Newton-Raphson step in the Ci’s Jacobian: Plus the first derivative vector:

  23. Spacetime constraint example Matrices i=j i=j-1, j+1 otherwise i=j Otherwise.

  24. Spacetime constraint example Matrices i=j Otherwise.

  25. Spacetime constraint example SQP step Solve 2 linear systems in sequence 1 Yields a step that minimizes a 2nd order approx. to R 2 Yields a step that drives linear approx. to Ci’s to zero And projects optimization step Sj to null space of constraint Jacobian.

  26. Spacetime constraint example Final update: Reaches fixed point: - When Ci’s = 0 - Any further decrease in R violates constraints.

  27. Constrained optimization

  28. Spacetime constraint example Note about Linear system solving Large matrices often with spacetime problems Inverting is O(n3) Spacetime problems almost always sparse Over and under constrainted systems easily arise Under constrained: pseudo-inverse Pseudo-inverse for sparse matrix sparse conjugate gradient algorithm: O(n2).

More Related