introduction to computer graphics animation...
Post on 24-Jun-2020
9 Views
Preview:
TRANSCRIPT
Introduction to Computer Graphics
โ Animation (2) โ
May 25, 2017
Kenshi Takayama
Physics-based animation of deforming objects
โข Classic: faithful simulation of physical phenomenaโข Mass-spring system
โข Finite Element Method (FEM)
โข CG-specific: plausible & robust, but not faithful simulationโข Shape Matching (Position-Based Dynamics)
2
Simple example: single mass & spring in 1D
โข Mass ๐, position ๐ฅ, spring coefficient ๐, rest length ๐, gravity ๐ :
๐๐2๐ฅ
๐๐ก2= โ๐ (๐ฅ โ ๐) + ๐
= ๐int ๐ฅ + ๐ext
โข ๐ext : External force (gravity, collision, user interaction)
โข ๐int ๐ฅ : Internal force (pulling the system back to original)
โข Springโs internal energy (potential):
๐ธ ๐ฅ โ๐
2๐ฅ โ ๐ 2
โข Internal force is the opposite of potential gradient:
๐int ๐ฅ โ โ๐๐ธ
๐๐ฅ= โ๐ ๐ฅ โ ๐
3
Equation of motion
๐
๐ฅ(๐ก) ๐ ๐
๐
๐
Mass-spring system in 3D
โข ๐ masses: ๐-th mass ๐๐ , position ๐ฅ๐ โ โ3
โข ๐ springs: ๐-th spring ๐๐ = ๐1, ๐2โข Coefficient ๐๐ , rest length ๐๐
โข Systemโs potential energy for a state ๐ฑ = (๐ฅ1, โฆ , ๐ฅ๐) โ โ3๐:
๐ธ ๐ฑ โ
๐๐= ๐1,๐2
๐๐2๐ฅ๐1 โ ๐ฅ๐2 โ ๐๐
2
โข Equation of motion:
๐๐2๐ฑ
๐๐ก2= โ๐๐ธ(๐ฑ) + ๐ext
โข ๐ โ โ3๐ร3๐ : Diagonal matrix made of ๐๐ (mass matrix) 4
๐๐
๐2
๐1
Continuous elastic model in 2D(Finite Element Method)โข ๐ vertices: ๐-th position ๐ฅ๐ โ โ
2
โข ๐ triangles: ๐-th triangle ๐ก๐ = (๐1, ๐2, ๐3)
โข Undeformed state: ๐ = (๐1, โฆ , ๐๐) โ โ2๐
โข Deformed state: ๐ฑ = ๐ฅ1, โฆ , ๐ฅ๐ โ โ2๐
โข Deformation gradient:
๐ ๐ ๐ฑ โ
โข Systemโs potential:๐ธ ๐ฑ โ
๐ก๐= ๐1,๐2,๐3
๐ด๐
2๐ ๐ ๐ฑ
โบ๐ ๐ ๐ฑ โ ๐ โฑ2
โข Equation of motion:
๐๐2๐ฑ
๐๐ก2= โ๐๐ธ(๐ฑ) + ๐ext
โข ๐ โ โ2๐ร2๐ : Diagonal matrix made of verticesโ Voronoi areas5
Area of ๐ก๐
Greenโs strain energy
โ โ2ร2
๐ฅ๐ 2โ๐ฅ๐ 1
๐ฅ๐ 3โ๐ฅ๐ 1
๐๐ 2โ๐๐ 1
๐๐ 3โ๐๐ 1
-1
Tessellate the domain
into triangular mesh
Linear transformation
which maps edges
๐
๐
Computing dynamics
โข Problem: Given initial value of position ๐ฑ(๐ก) and velocity ๐ฏ ๐ก โ๐๐ฑ
๐๐กas
compute ๐ฑ(๐ก) and ๐ฏ(๐ก) for ๐ก > 0. (Initial Value Problem)
โข Simple case of single mass & spring:
๐๐2๐ฅ
๐๐ก2= โ๐ ๐ฅ โ ๐ + ๐
analytic solution exists (sine curve)
โข General problems donโt have analytic solution From state ๐ฑ๐, ๐ฏ๐ at time ๐ก, compute next state๐ฑ๐+1, ๐ฏ๐+1 at time ๐ก + โ. (time integration)โข โ: time step
6
๐ฑ 0 = ๐ฑ0 and ๐ฏ 0 = ๐ฏ0 ,
Simplest method: Explicit Euler
Update velocity ๐ฏ๐+1 โ ๐ฏ๐ + โ ๐โ1 (๐int(๐ฑ๐) + ๐ext)
Update position ๐ฑ๐+1 โ ๐ฑ๐ + โ ๐ฏ๐+1
โข Pro: easy to compute
โข Con: overshooting
โข With larger time steps, mass can easilygo beyond the initial amplitude System energy explodes over time
7
Discretize acceleration
using finite difference:
๐๐ฏ๐+1โ๐ฏ๐
โ= ๐int ๐ฑ๐ + ๐ext
Method to be chosen: Implicit Euler
Find ๐ฑ๐+1, ๐ฏ๐+1 such that:
๐ฏ๐+1 = ๐ฏ๐ + โ ๐โ1 ๐int ๐ฑ๐+1 + ๐ext
๐ฑ๐+1 = ๐ฑ๐ + โ ๐ฏ๐+1
โข Represent ๐ฏ๐+1 using unknown position ๐ฑ๐+1
โข Pros: can avoid overshoot
โข Cons: expensive to compute (i.e. solve equation)
8
Inside of Implicit Euler
โข Reduce to root-finding problem of function ๐ :โ3๐ โฆ โ3๐
Newtonโs method:
โข Coefficient matrix of large linear system changes at every iteration high computational cost! 9
๐ฏ๐+1 = ๐ฏ๐ + โ ๐โ1 ๐int ๐ฑ๐+1 + ๐ext
Denote unknown ๐ฑ๐+1 as ๐ฒ
๐ฑ๐+1 = ๐ฑ๐ + โ ๐ฏ๐+1
๐ฒ ๐+1 โ ๐ฒ ๐ โ๐๐
๐๐ฒ
โ1
๐ (๐ฒ ๐ )
= ๐ฑ๐ + โ ๐ฏ๐ + โ2๐โ1 ๐int ๐ฑ๐+1 + ๐ext
= ๐ฑ๐ + โ ๐ฏ๐ + โ2๐โ1 โ๐๐ธ ๐ฑ๐+1 + ๐ext
= ๐ฒ ๐ โ โ2๐๐ธ ๐ฒ๐ +๐
โ1๐ (๐ฒ ๐ )
2nd derivative of potential ๐ธ (Hessian matrix)
โ2๐๐ธ ๐ฒ +๐ ๐ฒ โ๐ ๐ฑ๐ + โ ๐ฏ๐ โ โ2๐ext = ๐
๐ ๐ฒ
โข Both:โข System potential defined as the sum of deformation energy of small elementsโข Implicit Euler needed for both
โข Mass-spring:โข Inappropriate for modeling objects occupying continuous 2D/3D domainsโข Effective for modeling web-/mesh-like materialsโข https://www.youtube.com/watch?v=N520KFOxaDg
โข FEM:โข Higher computational cost in general
โข Good domain tessellationโข Complex potential energy
โข Can handle various (nonlinear) materialsโข http://graphics.cs.cmu.edu/projects/Bargteil-2007-AFE/Stuff/examples-360.mov
Mass-spring model vs continuous model (FEM)
10
Mass-spring
โณใ
FEM
ใโณ
Physical accuracy
Impl. / comput. cost
Physics-based animation of deforming objects
โข Classic: faithful simulation of physical phenomenaโข Mass-spring system
โข Finite Element Method (FEM)
โข CG-specific: plausible & robust, but not faithful simulationโข Shape Matching (Position-Based Dynamics)
11
Physics-based animation framework specialized for CGโข Pioneering work:
โข Meshless deformations based on shape matching[Mรผller et al., SIGGRAPH 2005]
โข Position Based Dynamics[Mรผller et al.,VRIPhys 2006]
โข Basic ideaCompute positions making potential zero (goal position),then pull particles toward them
โข System energy always decreases (never explodes)
โข Easy to compute perfect for games!
โข Not physically meaningful computation (e.g. FEM)โข OK for CG purposes 12
https://www.youtube.com/watch?v=CCIwiC37kks
Case of single mass & spring (no ext. force)
โข 0 โค ๐ผ โค 1 is โstiffnessโ parameter unique to PBDโข ๐ผ = 0 No update of velocity (spring is infinitely soft)
โข ๐ผ = 1 Spring is infinitely stiff (?)
Energy never explodes in any case
โข Note: Unit of ๐ผ/โ is (time)-1 ๐ผ has no physical meaning!
โข Reason why PBD is called non physics-based but geometry-based
13
๐ฃ๐+1 โ ๐ฃ๐ +โ ๐
๐๐ โ ๐ฅ๐
๐ฅ๐+1 โ ๐ฅ๐ + โ ๐ฃ๐+1
๐ ๐ฅ(๐ก)
๐
๐
๐
Explicit Euler Position-Based Dynamics
๐ฃ๐+1 โ ๐ฃ๐ +๐ผ
โ๐ โ ๐ฅ๐
๐ฅ๐+1 โ ๐ฅ๐ + โ ๐ฃ๐+1
Case of general deforming shape (no ext. force)
โข Goal position ๐ โข Rest shape rigidly transformed
such that it best matches the current deformed stateโข (SVD of moment matrix)
โข Called โShape Matchingโโข One technique within the PBD framework
โข Connectivity info (spring/mesh) not needed meshless
14
๐ฏ๐+1 โ ๐ฏ๐ โ โ ๐โ1๐๐ธ ๐ฑ๐
Explicit Euler Position-Based Dynamics
๐ฏ๐+1 โ ๐ฏ๐ +๐ผ
โ๐ ๐ฑ๐ โ ๐ฑ๐
๐ฑ๐+1 โ ๐ฑ๐ + โ ๐ฏ๐+1๐ฑ๐+1 โ ๐ฑ๐ + โ ๐ฏ๐+1
๐ฑ๐
๐ (๐ฑ๐)
๐ฑ0
Shape Matching per (overlapping) local region
โข More complex deformations
โข Acceleration techniques
15
Local regions from voxel lattice Local regions from octree Animating hair using
1D chain structureFastLSM; fast lattice shape matching for robust real-time deformation [Rivers SIGGRAPH07]
Fast adaptive shape matching deformations [Steinemann SCA08]
Chain Shape Matching for Simulating Complex Hairstyles [Rungjiratananon CGF10]
Extension: Deform rest shapes of local regions
16
https://www.youtube.com/watch?v=0AWtQbVBi3s
Autonomous motion of soft bodies Example-based deformations
https://www.youtube.com/watch?v=45QjojWiOEc
ProcDef; local-to-global deformation for skeleton-free character animation [Ijiri PG09]
Real-Time Example-Based Elastic Deformation [Koyama SCA12]
Position-Based Dynamics (PBD)
โข General framework including Shape Matching
โข Input: initial position ๐ฑ0 & velocity ๐ฏ0
โข At every frame:๐ฉ = ๐ฑ๐ + โ ๐ฏ๐ prediction
๐ฑ๐+1 = modify ๐ฉ position correction
๐ฎ = ๐ฑ๐+1 โ ๐ฑ๐ /โ velocity update
๐ฏ๐+1 = modify ๐ฎ velocity correction
17Position Based Dynamics [Mรผller et al., VRIPhys 2006]
http://www.csee.umbc.edu/csee/research/vangogh/I3D2015/matthias_muller_slides.pdf
(My understanding is still weak)
Robust Real-Time Deformation of Incompressible Surface Meshes [Diziol SCA11]
Long Range Attachments - A Method to Simulate Inextensible Clothing in Computer Games [Kim SCA12]
Position Based Fluids [Macklin SIGGRAPH13]
Position-based Elastic Rods [Umetani SCA14]
Position-Based Simulation of Continuous Materials [Bender Comput&Graph14]
Various geometric constraints available in PBD (other than Shape Matching)
18
Twist constraint
Stretch constraint
Volume constraintStrain constraint
Density constraint
Putting everything together: FLEX in PhysX
โข SDK released by NVIDIA!19Unified Particle Physics for Real-Time Applications [Macklin SIGGRAPH14]
https://www.youtube.com/watch?v=z6dAahLUbZg
Collisions
โข Another tricky issue
โข Popular methods in PBD:โข For each voxel grid, record
which particles it contains
โข Test collisions only among nearby particles
โข Recent method specialized for PBD
20
Collision detection for deformable objects [Teschner CGF05]
Staggered Projections for Frictional Contact in Multibody Systems [Kaufman SIGGRAPHAsia08]
Asynchronous Contact Mechanics [Harmon SIGGRAPH09]
Energy-based Self-Collision Culling for Arbitrary Mesh Deformations [Zheng SIGGRAPH12]
Air Meshes for Robust Collision Handling [Muller SIGGRAPH15]
[Harmon09]
[Zheng12][Kaufman08]
[Muller15]
Pointers
โข Surveys, tutorialsโข A Survey on Position-Based Simulation Methods in Computer Graphics [Bender CGF14]
โข http://www.csee.umbc.edu/csee/research/vangogh/I3D2015/matthias_muller_slides.pdf
โข Position-Based Simulation Methods in Computer Graphics [Bender EG15Tutorial]
โข Libraries, implementationsโข https://code.google.com/p/opencloth/
โข http://shapeop.org/
โข http://matthias-mueller-fischer.ch/demos/matching2dSource.zip
โข https://bitbucket.org/yukikoyama
โข https://developer.nvidia.com/physx-flex
โข https://github.com/janbender/PositionBasedDynamics
21
top related