physics-based simulaon - students.cs.ubc.ca
TRANSCRIPT
Physics-basedSimula1on
• simple(independentpar1cles),orcomplex(robustcolliding,stacking,sliding3Drigidbodies)
• manymanysimulators!– PhysX(Unity,Unreal),Bullet,OpenDynamicsEngine,MuJoCo,Havok,Box2D,Chipmunk,OpenSim,RBDL,Simulink(MATLAB),ADAMS,SD/FAST,DART,Vortex,SOFA,Avatar,ProjectChrono,Cannon.js,…
– manycourseprojects,theses,abandon-ware
Resources• hUps://processing.org/examples/see“Simulate”;2Dpar1clesystems• Non-convexrigidbodieswithstacking3Dcollisionprocessingandstacking
hUp://www.cs.ubc.ca/~rbridson/docs/rigid_bodies.pdf• Physically-basedModeling,coursenotes,SIGGRAPH2001,Baraff&Witkin
hUp://www.pixar.com/companyinfo/research/pbm2001/• DougJamesCS5643coursenotes
hUp://www.cs.cornell.edu/courses/cs5643/2015sp/• RigidBodyDynamics,ChrisHeckerhUp://chrishecker.com/Rigid_Body_Dynamics• Videogamephysicstutorial
hUps://www.toptal.com/game/video-game-physics-part-i-an-introduc1on-to-rigid-body-dynamics• Box2DjavascriptlivedemoshUp://heikobehrens.net/misc/box2d.js/examples/• RigidbodycollisionsjavascriptdemohUps://www.myphysicslab.com/engine2D/collision-en.html• RigidBodyCollisionReponse,MichaelManzke,courseslides
hUps://www.scss.tcd.ie/Michael.Manzke/CS7057/cs7057-1516-09-CollisionResponse-mm.pdf• Interac1vesimula1onofrigidbodydynamicsincomputergraphics,CGF2014
hUp://onlinelibrary.wiley.com/doi/10.1111/cgf.12272/abstract• AMathema1calIntroduc1ontoRobo1cManipula1on(textbook)
http://www.cds.caltech.edu/~murray/books/MLS/pdf/mls94-complete.pdf• Par1cle-basedFluidSimula1onforInterac1veApplica1ons,SCA2003,PDF• StableFluids,JosStam,SIGGRAPH1999.interac1vedemo:
hUps://29a.ch/2012/12/16/webgl-fluid-simula1on
Physically-basedSimula1on–movementgovernedbyforces
• par1clesystems– fire,water,smoke,(fluids,cloth,hair)– heuris1cs-basedormoreprincipled
• rigid-bodysimula1on– blocks,robots,humans
• con1nuumsystems– deformablesolids– fluids,cloth,hair
• groupmovement– flocks,crowds
OrdinaryDifferen1alEqua1onsdX(t)dt
= f (X(t), t)Given X0 = X(t0 )
X(t)Compute t > t0for
Simula1onasapaththroughstate-space,drivenbyavectorfield
PendulumSpring
Simula1onBasics
• simula1onloop– Equa1onsofMo1on
solvefordX/dt=f(X,forces,torques)– numericalintegra1on
updateposi1ons,veloci1es
– collisiondetec1on– collisionresolu1on
(numericalsolu1ontoODE)
ProxyForces• behaviorforces:
flockingbirds,schoolingfish,etc.[“Boids”,CraigReynolds,SIGGRAPH1987]
CurlnoiseforproceduralfluidflowR.Bridson,J.Hourihan,M.Nordenstam,Proc.SIGGRAPH2007.
ExplicitEuler:problems
Solu1onspiralsoutwardsnomaUerhowsmallthe1mestep!(althoughsmaller1mestepsares1llbeUer)
Orcanleadtoinstabili1es:
[PhysicallyBasedAnima1onWitkin&Baraff,SIGGRAPHcoursenotes]
Midpoint&Trapezoidmethods
[slideinpartfromMIT-OCW]
Secondorderaccurate;Midpointmethodalsoknownas“secondorderRunge-KuUa”
ImplicitEuler
Xn+1 = Xn + h f (Xn )Xn Xn+1
Xn+1 = Xn + h f (Xn+1)xn+1
backward“implicit”Euler
xn+1 = xn + hvn+1
vn+1 = vn + h(−kxn+1m
)
forward“explicit”Euler
xn+1 = xn + hvn
vn+1 = vn + h(−kxnm)
Idea:Usethederiva1veatthedes1na1onProblem:Wedon’tknowthedes1na1onyet!!
Simula1onLoop
foreach1mestep
setup
solveeqnsofmo1on
integrate
linearposi1onlinearvelocityangularorienta1onangularvelocity
RigidBodyCollisions
• CollisionDetec1on– broadphase:e.g.,AABBs,boundingspheres– narrowphase:detailedchecks
• CollisionResponse– collisionimpulses– constraintforces:res1ng,sliding,hinges,….
Par1cle-PlaneCollisionshUps://www.scss.tcd.ie/Michael.Manzke/CS7057/cs7057-1516-09-CollisionResponse-mm.pdf