Constrained Dynamics Marq Singer

Slides:



Advertisements
Similar presentations
Numerical Integration
Advertisements

Numeric Integration Methods Jim Van Verth Red Storm Entertainment
Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment
Four Five Physics Simulators for a Human Body Chris Hecker definition six, inc.
Collision Response Jim Van Verth
Real-Time Game Physics
Bending, Breaking and Squishing Stuff Marq Singer Red Storm Entertainment
Jason Clark Inverse Kinematics Jason Clark
Numerical Solution of Linear Equations
Physics for Game Programmers Contacts or “How (Not) To Make It Stick” Gino van den Bergen
Rigid Body Dynamics Jim Van Verth
COMP 175 | COMPUTER GRAPHICS Remco Chang1/6103b – Shapes Lecture 03b: Shapes COMP 175: Computer Graphics February 3, 2015.
Advanced Character Physics
Chapter: 3c System of Linear Equations
Kinetics of Particles Impulse and Momentum.
Integration Techniques
MATH 685/ CSI 700/ OR 682 Lecture Notes
Linear Systems of Equations
Jonathan Richard Shewchuk Reading Group Presention By David Cline
Foundations of Computer Graphics (Spring 2010) CS 184, Lecture 24: Animation Many slides courtesy Adam Finkelstein,
Game Physics Chris Miles. The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order.
UNC Chapel Hill M. C. Lin Announcements Homework #1 is due on Tuesday, 2/10/09 Reading: SIGGRAPH 2001 Course Notes on Physically-based Modeling.
UNC Chapel Hill S. Redon - M. C. Lin Rigid body dynamics II Solving the dynamics problems.
Kinematics. ILE5030 Computer Animation and Special Effects2 Kinematics The branch of mechanics concerned with the motions of objects without regard to.
Articulated Body Dynamics The Basics Comp 768 October 23, 2007 Will Moss.
Monica Garika Chandana Guduru. METHODS TO SOLVE LINEAR SYSTEMS Direct methods Gaussian elimination method LU method for factorization Simplex method of.
1cs533d-winter-2005 Notes  Assignment 2 instability - don’t worry about it right now  Please read D. Baraff, “Fast contact force computation for nonpenetrating.
Modeling, Simulating and Rendering Fluids Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan.
Dynamics 101 Jim Van Verth Red Storm Entertainment
Scientific Computing Matrix Norms, Convergence, and Matrix Condition Numbers.

Physics for Game Developers Jim Van Verth Christer Ericson Squirrel Eiserloh Gino van den Bergen Erin Catto Marq Singer.
Game Physics – Part IV Moving to 3D
Systems of Linear Equations Iterative Methods
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
Systems of Particles.
Modeling and Solving Constraints Erin Catto Blizzard Entertainment.
Large Steps in Cloth Simulation - SIGGRAPH 98 박 강 수박 강 수.
Computer Graphics Soft Body Animation - Skinning CO2409 Computer Graphics Week 22.
Computer Animation Rick Parent Computer Animation Algorithms and Techniques Optimization & Constraints Add mention of global techiques Add mention of calculus.
1 Solution of Nonlinear Equation Dr. Asaf Varol
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
Beyond Bouncing Boxes Fast, yet still Realistic, Deformation and Fracture Jeff Lander Darwin 3D, LLC Luxoflux James O'Brien U. of California, Berkeley.
Chapter 14 Systems of Particles.
CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Rick Parent - CIS682 Rigid Body Dynamics simulate basic physics of an object subject to forces Keyframing can be tedious - especially to get ‘realism’
Advanced Computer Graphics Spring 2014 K. H. Ko School of Mechatronics Gwangju Institute of Science and Technology.
Spacetime Constraints Chris Moore CS 552. Purpose Physically Accurate Realistic Motion.
Advanced Computer Graphics Rigid Body Simulation
Physically Based Simulations For Games
Character Animation Forward and Inverse Kinematics
Solving Systems of Linear Equations: Iterative Methods
Iterative Methods Good for sparse matrices Jacobi Iteration
Lecture 19 MA471 Fall 2003.
By Tiantian Liu et al (SIGGRAPH 2017) Presented By Anirudh Ganesh
Announcements Homework #0 is due this Wednesday, 1/30/02
MATLAB EXAMPLES Matrix Solution Methods
Disclaimer The following slides reuse materials from SIGGRAPH 2001 Course Notes on Physically-based Modeling (copyright  2001 by David Baraff at Pixar).
Advanced Computer Graphics Spring 2008
Engineering Mechanics: Statics
Disclaimer The following slides reuse materials from SIGGRAPH 2001 Course Notes on Physically-based Modeling (copyright  2001 by David Baraff at Pixar).
Numerical Linear Algebra
Advanced Games Development Game Physics
Physically Based Modeling -Overview-
Linear Algebra Lecture 16.
Computer Animation Algorithms and Techniques
Presentation transcript:

Constrained Dynamics Marq Singer

Essential Math for Games The Problem What are they Why do we care What are they good for

Essential Math for Games The Basics Constraint – something that keeps an entity in the system from moving freely For our purposes, we will treat each discreet entity as one particle in a system Particles can be doors on hinges, bones in a skeleton, points on a piece of cloth, etc.

Essential Math for Games Box Constraints Simplest case Movement constrained within a 2D area

Essential Math for Games Box Constraints P 100 0

Essential Math for Games Box Constraints (cont) Restrict P to extents of the box Recover from violations in position (last valid, rebound, wrap around) Simple, yet the basis for the rest of this

Essential Math for Games Bead on a Wire The Problem: Restrict bead to path Solutions: Explicit (parametric) method Implicit method

Essential Math for Games Parametric Constraints

Essential Math for Games Bead on a Wire From Baraff, Witkin N = gradient f = force f c = constraint force f = f + f c

Essential Math for Games Implicit Representation legal position legal velocity legal acceleration

Essential Math for Games Implicit Representation Constraint force = gradient vector times scalar

Essential Math for Games Spring Constraints Seems like a reasonable choice for soft body dynamics (cloth) In practice, not very useful Unstable, quickly explodes

Essential Math for Games Stiff Constraints A special spring case does work Ball and Stick/Tinkertoy Particles stay a fixed distance apart Basically an infinitely stiff spring Simple Not as prone to explode

Essential Math for Games Cloth Simulation Use stiff springs Solving constraints by relaxation Solve with a linear system

Essential Math for Games Cloth Simulation

Essential Math for Games Cloth Simulation Forces on our cloth

Essential Math for Games Cloth Simulation Relaxation is simple Infinitely rigid springs are stable 1.Predetermine C i distance between particles 2.Apply forces (once per timestep) 3.Calculate for two particles 4.If move each particle half the distance 5.If n = 2, youre done!

Essential Math for Games Relaxation Methods

Essential Math for Games Relaxation Methods

Essential Math for Games Cloth Simulation When n > 2, each particles movement influenced by multiple particles Satisfying one constraint can invalidate another Multiple iterations stabilize system converging to approximate constraints Forces applied before iterations Fixed timestep (critical)

Essential Math for Games More Cloth Simulation Use less rigid constraints Vary the constraints in each direction (i.e. horizontal stronger than vertical) Warp and weft constraints

Essential Math for Games Still More Cloth Simulation Sheer Springs

Essential Math for Games Still More Cloth Simulation Flex Springs

Essential Math for Games Articulated Bodies Pin Joints Hinges

Essential Math for Games Angular Constraints Restrict the angle between particles Results in a cone-shaped constraint

Essential Math for Games Angular Constraints Unilateral distance constraint Only apply constraint in one direction

Essential Math for Games Angular Constraints Dot product constraint Recovery is a bit more involved

Essential Math for Games Stick Man Uses points and hinges Angular (not shown) allow realistic orientations Graphic example of why Im an engineer and not an artist

Essential Math for Games Using A Linear System Can sum up forces and constraints Represent as system of linear equations Solve using matrix methods

Essential Math for Games Basic Stuff Systems of linear equations Where: A = matrix of coefficients x = column vector of variables b = column vector of solutions

Essential Math for Games Basic Stuff Populating matricies is a bit tricky, see [Boxerman] for a good example Isolating the ith equation:

Essential Math for Games Jacobi Iteration Solve for x i (assume other entries in x unchanged): (Which is basically what we did a few slides back)

Essential Math for Games Jacobi Iteration In matrix form: D, -L, -U are subparts of A D = diagonal -L = strictly lower triangular -U = strictly upper triangular

Essential Math for Games Jacobi Iteration Definition (diagonal, strictly lower, strictly upper): A = D - L - U

Essential Math for Games Gauss-Seidel Iteration Uses previous results as they are available

Essential Math for Games Gauss-Seidel Iteration In matrix form:

Essential Math for Games Gauss-Seidel Iteration Components depend on previously computed components Cannot solve simultaneously (unlike Jacobi) Order dependant If order changes the components of new iterates change

Essential Math for Games Successive Over Relaxation (SOR) Gauss-Seidel has convergence problems SOR is a modification of Gauss-Seidel Add a parameter to G-S

Essential Math for Games Successive Over Relaxation (SOR) = a Gauss-Seidel iterate 0 < If = 1, simplifies to plain old Gauss- Seidel

Essential Math for Games Gauss-Seidel Iteration In matrix form:

Essential Math for Games Lots More Math (not covered here) I highly recommend [Shewchuk 1994] Steepest Descent Conjugate Gradient Newtons Method (in some cases) Hessian Newton variants (Discreet, Quasi, Truncated)

Essential Math for Games References Boxerman, Eddy and Ascher, Uri, Decomposing Cloth, Eurographics/ACM SIGGRAPH Symposium on Computer Animation (2004) Eberly, David, Game Physics, Morgan Kaufmann, Jakobsen, Thomas, Advanced Character Physics, Gamasutra Game Physics Resource Guide Mathews, John H. and Fink, Kurtis K., Numerical Methods Using Matlab, 4th Edition, Prentice-Hall 2004 Shewchuk, Jonathan Richard, An Introduction to the Conjugate Gradient Method Without the Agonizing Pain, August cs.cmu.edu/~jrs/jrspapers.html Witken, Andrew, David Baraff, Michael Kass, SIGGRAPH Course Notes, Physically Based Modeling, SIGGRAPH Yu, David, The Physics That Brought Cel Damage to Life: A Case Study, GDC 2002