Four Five Physics Simulators for a Human Body Chris Hecker definition six, inc.

Slides:



Advertisements
Similar presentations
My Adventure with Inverse Kinematics
Advertisements

Numeric Integration Methods Jim Van Verth Red Storm Entertainment
Neat Stuff from Vector Calculus & Related Subjects Chris Hecker definition six, inc. & Maxis.
Five Physics Simulators for Articulated Bodies Chris Hecker definition six, inc.
Formal Computational Skills
COMP Robotics: An Introduction
Rigid Body Dynamics Jim Van Verth
Lecture 5: Constraints I
The robot structure model design 2 Curse 5. Modeling: the robot AcTrMStTk V(t) T(t)  (t) q(t) x(t)
Lecture 2. A Day of Principles The principle of virtual work d’Alembert’s principle Hamilton’s principle 1 (with an example that applies ‘em all at the.
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
Integration Techniques
Animation Following “Advanced Animation and Rendering Techniques” (chapter 15+16) By Agata Przybyszewska.
Dynamics of Articulated Robots Kris Hauser CS B659: Principles of Intelligent Robot Motion Spring 2013.
1cs542g-term Notes  Notes for last part of Oct 11 and all of Oct 12 lecture online now  Another extra class this Friday 1-2pm.
CSCE 641: Forward kinematics and inverse kinematics Jinxiang Chai.
1Notes  Handing assignment 0 back (at the front of the room)  Read the newsgroup!  Planning to put 16mm films on the web soon (possibly tomorrow)
Adaptive dynamics for Articulated Bodies. Articulated Body dynamics Optimal forward dynamics algorithm –Linear time complexity –e.g. Featherstone’s DCA.
CSCE 641: Forward kinematics and inverse kinematics Jinxiang Chai.
Forward Kinematics.
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.
Adaptive Dynamics of Articulated Bodies. Articulated bodies in Computer Graphics – Humans, hair, animals – Trees, forests, grass – Deformable bodies –
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
CSCE 689: Forward Kinematics and Inverse Kinematics
1cs533d-winter-2005 Notes  Assignment 2 instability - don’t worry about it right now  Please read D. Baraff, “Fast contact force computation for nonpenetrating.
Computer graphics & visualization Rigid Body Simulation.
Lecture 20: Putting it all together An actual mechanism A physical abstraction: links, springs, wheels, motors, etc. A mathematical model of the physical.
Dynamics 101 Jim Van Verth Red Storm Entertainment
Module 1 Introduction to Ordinary Differential Equations Mr Peter Bier.
역운동학의 구현과 응용 Implementation of Inverse Kinematics and Application 서울대학교 전기공학부 휴먼애니메이션연구단 최광진
Feature-length films: Games: Desktop Animations: Computer Animation.
Writing a Hair Dynamics Solver Tae-Yong Kim Rhythm & Hues Studios
Definition of an Industrial Robot
Game Physics – Part IV Moving to 3D
Game Physics – Part I Dan Fleck Coming up: Rigid Body Dynamics.
Erin Catto Blizzard Entertainment Numerical Integration.
Lecture 2: Introduction to Concepts in Robotics
ME451 Kinematics and Dynamics of Machine Systems Dynamics of Planar Systems December 1, 2011 Solving Index 3 DAEs using Newmark Method © Dan Negrut, 2011.
© 2011 Autodesk Freely licensed for use by educational institutions. Reuse and changes require a note indicating that content has been modified from the.
 d.s. wu 1 Penalty Methods for Contact Resolution interactive contact resolution that usually works pi david s wu.
CSCE 441: Computer Graphics Forward/Inverse kinematics Jinxiang Chai.
ME451 Kinematics and Dynamics of Machine Systems Basic Concepts in Planar Kinematics 3.1, 3.2 September 18, 2013 Radu Serban University of Wisconsin-Madison.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
ME451 Kinematics and Dynamics of Machine Systems Introduction to Dynamics 6.1 October 09, 2013 Radu Serban University of Wisconsin-Madison.
ME451 Kinematics and Dynamics of Machine Systems Singular Configurations 3.7 October 07, 2013 Radu Serban University of Wisconsin-Madison.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Physics for Games Spring 2012.
1cs426-winter-2008 Notes  Will add references to splines on web page.
ME451 Kinematics and Dynamics of Machine Systems Numerical Integration October 28, 2013 Radu Serban University of Wisconsin-Madison.
1cs426-winter-2008 Notes. 2 Kinematics  The study of how things move  Usually boils down to describing the motion of articulated rigid figures Things.
Canonical Equations of Motion -- Hamiltonian Dynamics
The Mechanical Simulation Engine library An Introduction and a Tutorial G. Cella.
CSCE 441: Computer Graphics Forward/Inverse kinematics Jinxiang Chai.
Feature-length films: Games: Desktop Animations:.
Numerical Methods for Inverse Kinematics Kris Hauser ECE 383 / ME 442.
ME451 Kinematics and Dynamics of Machine Systems Dynamics of Planar Systems November 4, 2010 Chapter 6 © Dan Negrut, 2010 ME451, UW-Madison TexPoint fonts.
Physics-Based Simulation: Graphics and Robotics Chand T. John.
ME451 Kinematics and Dynamics of Machine Systems Dynamics of Planar Systems December 9, 2010 Solving Index 3 DAEs using Newmark Method © Dan Negrut, 2010.
Advanced Computer Graphics Rigid Body Simulation
Physically Based Simulations For Games
Physically-Based Motion Synthesis in Computer Graphics
CSCE 441: Computer Graphics Forward/Inverse kinematics
Character Animation Forward and Inverse Kinematics
Introduction To Robotics
CSCE 441: Computer Graphics Forward/Inverse kinematics
Synthesis of Motion from Simple Animations
Introduction Constraint: important features in computer animation
Adaptive dynamics for Articulated Bodies
Presentation transcript:

Four Five Physics Simulators for a Human Body Chris Hecker definition six, inc.

Four^H^H^Hive Physics Simulators for a Human Body Chris Hecker definition six, inc.

Prerequisites comfortable with math concepts, modeling, and equations kinematics vs. dynamics familiar with rigid body dynamics probably have written a physics simulator for a game, or at least read about it in detail

Takeaway pros and cons & subtleties of 4 different simulation techniques –all are useful, but different strengths 2 key concepts: –degrees of freedom, configuration space, etc. –stiffness, and why it is important all examples are 2D, but generalize directly to 3D not going to be detailed tutorial

A Couple Other Related Talks David Wus talk on mixing kinematics & dynamics Saturday, 2:30pm - 3:30pm Experimental Gameplay Workshop Friday, 4:30pm - 6:30pm

Before Physics I Tried... Cyclic Coordinate Descent IK demo –my rock climbing game works okay, but problems: –non-physical movement –no closed loops –no clear path to adding muscle controls

Physics Solutions rigid bodies with constraints need to simulate enough to make articulated figure 1st-order dynamics f = mv no inertia/momentum; no force, no movement mouse attached by spring or constraint must be tight control hands/feet attached by springs or constraints must stay locked to the positions

I Tried Four Techniques Augmented Coordinates / Explicit Integration Lagrange Multipliers Augmented Coordinates / Implicit Integration Implicit Springs Generalized Coordinates / Explicit Integration Composite Rigid Body Method Generalized Coordinates / Implicit Integration Implicit Recursive Newton Euler demo of all four running at once

Obvious Axes of the Techniques Augmented vs. Generalized Coordinates –ways of representing the degrees-of-freedom (DOF) of the systems Explicit vs. Implicit Integration –ways of stepping those DOFs forward in time

Augmented Coordinates aka. Lagrange Multipliers, constraint methods calculate constraint forces and apply them simulate each body independently constraint forces keep bodies together 6DOF - 2DOF = 4DOF f

Generalized Coordinates aka. reduced coordinates, embedded methods, recursive methods calculate and simulate only the real DOF of the system one rigid body and joints 3DOF + 1DOF = 4DOF

Degrees Of Freedom (DOF) DOF is a critical concept in all math find the DOF to understand the system coordinates necessary and sufficient to reach every valid state examples: point in 2D: 2DOF, point in 3D: 3DOF 2D rigid body: 3DOF, 3D rigid body: 6DOF point on a line: 1DOF, point on a plane: 2DOF simple desk lamp: 3DOF (or 5DOF counting head)

DOF Continued systems have DOF, equations on those DOF constrain them example, 2D point, on line configuration space is the space of the DOF manifold is the c-space, usually viewed as embedded in the original space (x,y) x = 2y (x,y) = (t,2t)

Augmented vs. Generalized Coordinates, Revisited augmented coordinates: dynamics equations + constraint equations general, modular, plugnplay, breakable big (often sparse) linear systems simulating useless DOF generalized coordinates: dynamics equations complicated, custom coded small dense nonlinear systems no closed loops, no nonholonomic constraints

Stiffness fast-changing systems are stiff the real world is incredibly stiff rigid body is a simplification to avoid stiffness most game UIs are incredibly stiff the mouse is insanely stiff, IK demo kinematically animating objects can be arbitrarily stiff animating the position with no derivative constraints

Handling Stiffness You want to handle as much stiffness as you can! gives designers control can always make things softer, thats easy its very hard to handle explicit integrator will not handle stiff systems without tiny timestep thats almost a definition of numerical stiffness! :)

Stiffness Example example: exponential decay demo of increasing spring constant dy/dx = -ydy/dx = -10y

Explicit vs. Implicit Integrators explicit jumps forward to next position blindly leap based on current information implicit jumps back from next position find a next position that points to current

Four Simulators In More Detail Augmented Coordinates / Explicit Integration Lagrange Multipliers Augmented Coordinates / Implicit Integration Implicit Springs Generalized Coordinates / Explicit Integration Composite Rigid Body Method Generalized Coordinates / Implicit Integration Implicit Recursive Newton Euler spend a few slides on this technique best for game humans?

Four Simulators In More Detail Augmented / Explicit Lagrange Multipliers form dynamics equations for bodies form constraint equations solve for constraint forces apply forces to bodies integrate bodies forward in time RK explicit integrator pros: simple, modular, general cons: medium sized matrices, drift, nonstiff references: Baraff, Shabana, Barzel & Barr, my ponytail articles

Four Simulators In More Detail Augmented / Implicit Implicit Springs form dynamics equations write constraints as stiff springs use implicit integrator to solve for next state Shampines ode23s adaptive timestep, or semi- implicit Euler pros: simple, modular, general, stiff cons: inexact, big matrices, needs derivatives references: Baraff (cloth), Kass, Lander

Four Simulators In More Detail Generalized / Explicit Composite Rigid Body Method form tree structured augmented system traverse tree computing dynamics on generalized coordinates incrementally outward and inward iterations integrate state forward RK pros: small matrices, explicit joints cons: dense, nonstiff, not modular references: Featherstone, Mirtich, Balafoutis

Four Simulators In More Detail Generalized / Implicit Implicit Recursive Newton Euler form generalized coordinate dynamics differentiate for implicit integrator fully implicit Euler solve system for new state pros: small matrices, explicit joints, stiff cons: dense, not modular, needs derivatives references: Wu, Featherstone

Generalized / Implicit Some Derivation f = f joints + f ext = mv Forward Dynamics Algorithm given joint forces, compute velocities (accelerations) v = (f joints + f ext )/m Inverse Dynamics Algorithm given velocities (accelerations), compute joint forces f joints = mv - f ext you can use an IDA to check for equilibrium given a velocity if f joints = 0, then the current velocity balances the external forces, or f - mv = 0 (which is just a rewrite of f = mv)

Generalized / Implicit Some Derivation (cont.) IDA gives F(q,q) when F(q,q) = 0, then system is moving correctly we want F(q 1, q 1 ) = 0, the solution at the new time implicit Euler equation: q 1 = q 0 + h q 1 q 1 = q 0 + h q 1... q 1 = (q 1 - q 0 ) / h plugnchug: F(q 0 + h q 1, q 1 ) = 0 this is a function in q 1, because q 0 is known we can use a nonlinear equation solver to solve F for q 1, then use this to step forward with implicit Euler

Problem: Solving F(q 1 ) = 0 can be hard! (but its very well documented) open problem solve vs. minimize?

The 5th Simulator Current best: implicit Euler with F(q) = 0 Newton solve lots of wacky subdivision and searching to help find solutions –want to avoid adaptivity, but cant in reality doesnt always work, finds no solution, bails Idea: the ode23s adaptive integrator will find the answer, but slowly the Newton solve sometimes cannot find the answer, no matter how slowly because it lacks info spend time optimizing the ode23s, because at least it has more information to go on

Summary simulating an articulated rigid body is hard, and there are a lot of tradeoffs and subtleties there is no single perfect algorithm yet? stiffness is very important to handle for most games generalized coordinates with implicit integration is the best bet so far for run-time maybe augmented explicit (?) for author-time tools Ill put the slides on my page at d6.com