Introduction to Computer Graphics. Animation (2) May 26, 2016 Kenshi Takayama

Similar documents
T6: Position-Based Simulation Methods in Computer Graphics. Jan Bender Miles Macklin Matthias Müller

Simulation in Computer Graphics. Deformable Objects. Matthias Teschner. Computer Science Department University of Freiburg

Mass-Spring Systems. Last Time?

The Jello Cube Assignment 1, CSCI 520. Jernej Barbic, USC

The jello cube. Undeformed cube. Deformed cube

Physically Based Simulation

Physically Based Simulation

Chapter 3: Computer Animation Reminder: Descriptive animation. Procedural animation : Examples. Towards methods that generate motion?

Simulation in Computer Graphics. Particles. Matthias Teschner. Computer Science Department University of Freiburg

Realtime Water Simulation on GPU. Nuttapong Chentanez NVIDIA Research

2.7 Cloth Animation. Jacobs University Visualization and Computer Graphics Lab : Advanced Graphics - Chapter 2 123

Cloth Simulation. Tanja Munz. Master of Science Computer Animation and Visual Effects. CGI Techniques Report

Cloth Simulation. COMP 768 Presentation Zhen Wei

Cloth Hair. and. soft bodies

Particle-based Fluid Simulation

Interaction of Fluid Simulation Based on PhysX Physics Engine. Huibai Wang, Jianfei Wan, Fengquan Zhang

Shape of Things to Come: Next-Gen Physics Deep Dive

Navier-Stokes & Flow Simulation

Fluid Simulation. [Thürey 10] [Pfaff 10] [Chentanez 11]

Overview of Traditional Surface Tracking Methods

Modeling Cloth Using Mass Spring Systems

Particle Systems. Lecture 8 Taku Komura

animation computer graphics animation 2009 fabio pellacini 1 animation shape specification as a function of time

animation computer graphics animation 2009 fabio pellacini 1

A Geometric Approach to Animating Thin Surface Features in SPH Water

CS 231. Deformation simulation (and faces)

Position Based Dynamics for Character Effects

Fast Simulation of Mass-Spring Systems

Example 24 Spring-back

Navier-Stokes & Flow Simulation

Dynamical Simulation 1: Particle Systems and ODEs

ROSE-HULMAN INSTITUTE OF TECHNOLOGY

View-Dependent Control of Elastic Rod Simulation for 3D Character Animation

1.2 Numerical Solutions of Flow Problems

2.11 Particle Systems

PHYSICALLY BASED ANIMATION

Soft Body Deformation Dynamics Based on Shape Matching

DYNAMIC SIMULATION OF INEXTENSIBLE CLOTH

Fracture & Tetrahedral Models

Divergence-Free Smoothed Particle Hydrodynamics

Cloth Animation with Collision Detection

Dynamics in Maya. Gary Monheit Alias Wavefront PHYSICALLY BASED MODELING SH1 SIGGRAPH 97 COURSE NOTES

Anatomy of a Physics Engine. Erwin Coumans

Chain Shape Matching for Simulating Complex Hairstyles

Support for Multi physics in Chrono

Application of Finite Volume Method for Structural Analysis

CLOTH - MODELING, DEFORMATION, AND SIMULATION

Real-time. Meshless Deformation. Xiaohu Guo, Hong Qin Center for Visual Computing Department of Computer Science Stony Brook

1. Carlos A. Felippa, Introduction to Finite Element Methods,

Twisting, Tearing and Flicking Effects in String Animations

Rigid Body Dynamics, Collision Response, & Deformation

FEMLAB Exercise 1 for ChE366

Topics in Computer Animation

A Fast and Stable Approach for Restoration of Warped Document Images

COMP 175 COMPUTER GRAPHICS. Lecture 10: Animation. COMP 175: Computer Graphics March 12, Erik Anderson 08 Animation

Flexible multibody systems - Relative coordinates approach

CS-184: Computer Graphics Lecture #21: Fluid Simulation II

Last Time? Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

Simulation in Computer Graphics. Introduction. Matthias Teschner. Computer Science Department University of Freiburg

Co-rotational Finite Element Solid Simulation with Collisions. Patrick Riordan

Meshless Modeling, Animating, and Simulating Point-Based Geometry

Real-Time Hair Simulation and Rendering on the GPU. Louis Bavoil

CS 231. Deformation simulation (and faces)

Partial Differential Equations

A Chebyshev Semi-Iterative Approach for Accelerating Projective and Position-based Dynamics

Lesson 1: Introduction to Pro/MECHANICA Motion

Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications

Hair Simulation (and Rendering)

Last Time? Animation, Motion Capture, & Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

Implicit Integration Collision Detection

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

A New Self-Collision Detection Method for Cloth Simulation

Last Time? Animation, Motion Capture, & Inverse Kinematics. Today. Keyframing. Physically-Based Animation. Procedural Animation

NUMERICAL COUPLING BETWEEN DEM (DISCRETE ELEMENT METHOD) AND FEA (FINITE ELEMENTS ANALYSIS).

Non-Rigid Image Registration III

Chapter 19- Object Physics

CGT 581 G Fluids. Overview. Some terms. Some terms

Animation of Fluids. Animating Fluid is Hard

Introduction to Computer Graphics. Modeling (3) April 27, 2017 Kenshi Takayama

A simple example. Assume we want to find the change in the rotation angles to get the end effector to G. Effect of changing s

3D Physics Engine for Elastic and Deformable Bodies. Liliya Kharevych and Rafi (Mohammad) Khan Advisor: David Mount

Chain Shape Matching for Simulating Complex Hairstyles

An Analysis of Interactive Deformable Solid Object Modeling

NVIDIA. Interacting with Particle Simulation in Maya using CUDA & Maximus. Wil Braithwaite NVIDIA Applied Engineering Digital Film

Rigid Body Dynamics, Fracture, & Deformation

Adaptive cloth simulation using corotational finite elements

Cloth and Hair Collisions

Nonlinear Real-time Finite Element Analysis using CUDA

C O M P U T E R G R A P H I C S. Computer Animation. Guoying Zhao 1 / 66

Strain Based Dynamics

CUDA. Fluid simulation Lattice Boltzmann Models Cellular Automata

An Introduction to Flow Visualization (1) Christoph Garth

Discrete representations of geometric objects: Features, data structures and adequacy for dynamic simulation. Part I : Solid geometry

Animation. CS 4620 Lecture 33. Cornell CS4620 Fall Kavita Bala

11/1/13. Visualization. Scientific Visualization. Types of Data. Height Field. Contour Curves. Meshes

Visualization. CSCI 420 Computer Graphics Lecture 26

Reclustering for Large Plasticity in Clustered Shape Matching

Application of Computational MBD for Simulation of Wrap Packaging Performance

Constraint fluids in Sprinkle. Dennis Gustafsson Mediocre

Chapter 1 - Basic Equations

Transcription:

Introduction to Computer Graphics Animation (2) May 26, 2016 Kenshi Takayama

Physically-based deformations 2

Simple example: single mass & spring in 1D Mass m, position x, spring coefficient k, rest length l, gravity g : m d2 x Equation of motion = k (x l) + g dt2 = f int x + f ext f ext : External force (gravity, collision, user interaction) f int x : Internal force (pulling the system back to original) O k l x(t) m g Spring s internal energy (potential): E x k 2 x l 2 Internal force is the opposite of potential gradient: f int x de dx = k x l 3

Mass-spring system in 3D N masses: i-th mass m i, position x i R 3 M springs: j-th spring e j = i 1, i 2 Coefficient k j, rest length l j i 1 l j i 2 System s potential energy for a state x = (x 1,, x N ) R 3N : Equation of motion: E x e j = i 1,i 2 M d2 x dt 2 k j 2 x i1 x i2 l j 2 = E(x) + f ext M R 3N 3N : Diagonal matrix made of m i (mass matrix) 4

Continuous elastic model in 2D (Finite Element Method) N vertices: i-th position x i R 2 M triangles: j-th triangle t j = (i 1, i 2, i 3 ) Tessellate the domain into triangular mesh Undeformed state: X = (X 1,, X N ) R 2N Deformed state: x = x 1,, x N R 2N Deformation gradient: F j x x i 2 x i1 x i 3 x i1 X i 2 X i1 X i 3 X i1-1 R 2 2 F F Linear transformation which maps edges System s potential: Equation of motion: E x t j = i 1,i 2,i 3 M d2 x dt 2 Area of t j A j 2 F j x F j x I F 2 = E(x) + f ext M R 2N 2N : Diagonal matrix made of vertices Voronoi areas Green s strain energy 5

Computing dynamics Problem: Given initial value of position x(t) and velocity v t dx x 0 = x 0 and v 0 = v 0, compute x(t) and v(t) for t > 0. (Initial Value Problem) Simple case of single mass & spring: m d2 x dt 2 = k x l + g analytic solution exists (sine curve) General problems don t have analytic solution From state x n, v n at time t, compute next state x n+1, v n+1 at time t + h. (time integration) dt as h: time step 6

Simplest method: Explicit Euler Discretize acceleration using finite difference: = f int x n + f ext M v n+1 v n h Update velocity v n+1 v n + h M 1 (f int (x n ) + f ext ) Update position Pro: easy to compute Con: overshooting x n+1 x n + h v n+1 With larger time steps, mass can easily go beyond the initial amplitude System energy explodes over time 7

Method to be chosen: Implicit Euler Find x n+1, v n+1 such that: v n+1 = v n + h M 1 f int x n+1 + f ext x n+1 = x n + h v n+1 Represent v n+1 using unknown position x n+1 Pros: can avoid overshoot Cons: expensive to compute (i.e. solve equation) 8

Inside of Implicit Euler x n+1 = x n + h v n+1 v n+1 = v n + h M 1 f int x n+1 + f ext = x n + h v n + h 2 M 1 f int x n+1 + f ext Denote unknown x n+1 as y = x n + h v n + h 2 M 1 E x n+1 + f ext F y h 2 E y + M y M x n + h v n h 2 f ext = 0 Reduce to root-finding problem of function F: R 3N R 3N Newton s method: y i+1 y i df dy Coefficient matrix of large linear system changes at every iteration high computational cost! 1 F(y i ) = y i h 2 H E y i + M 1 F(y i ) 2 nd derivative of potential E (Hessian matrix) 9

Mass-spring model vs continuous model (FEM) 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 FEM: Higher computational cost in general Good domain tessellation Complex potential energy Can handle various (nonlinear) materials Physical accuracy Impl. / comput. cost Mass-spring 〇 FEM 〇 10

Position-Based Dynamics 11

PBD: Physics-based animation framework specialized for CG First PBD papers: Meshless deformations based on shape matching [Müller et al., SIGGRAPH 2005] Position Based Dynamics [Müller et al.,vriphys 2006] Basic idea Compute positions making potential zero (goal position), then pull particles toward them https://www.youtube.com/watch?v=cciwic37kks System energy always decreases (never explodes) Easy to compute perfect for games! Not physically meaningful computation (e.g. FEM) OK for CG purposes 12

Case of single mass & spring (no ext. force) k m Explicit Euler v n+1 v n + h k m l x n Position-Based Dynamics v n+1 v n + α l x h n x n+1 x n + h v n+1 x n+1 x n + h v n+1 O l x(t) 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 α/h is (time) -1 α has no physical meaning! Reason why PBD is called non physics-based but geometry-based 13

Case of general deforming shape (no ext. force) Explicit Euler v n+1 v n h M 1 E x n x n+1 x n + h v n+1 Goal position g Rest shape rigidly transformed such that it best matches the current deformed state (SVD of moment matrix) x 0 Position-Based Dynamics v n+1 v n + α g x h n x n x n+1 x n + h v n+1 g(x n ) x n Called Shape Matching One technique within the PBD framework Connectivity info (spring/mesh) not needed meshless 14

Shape Matching per (overlapping) local region More complex deformations Acceleration techniques Local regions from voxel lattice Local regions from octree Animating hair using 1D chain structure FastLSM; 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] 15

Extension: Deform rest shapes of local regions Autonomous motion of soft bodies Example-based deformations https://www.youtube.com/watch?v=0awtqbvbi3s 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] 16

General procedure of PBD Input: initial position x 0 & velocity v 0 At every frame: p = x n + h v n prediction x n+1 = modify p position correction u = x n+1 x n /h velocity update v n+1 = modify u velocity correction (My understanding is still weak) Position Based Dynamics [Müller et al., VRIPhys 2006] http://www.csee.umbc.edu/csee/research/vangogh/i3d2015/matthias_muller_slides.pdf 17

Various geometric constraints available in PBD (other than Shape Matching) Twist constraint Stretch constraint Volume constraint Strain constraint 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] Density constraint 18

Putting everything together: FLEX in PhysX SDK released by NVIDIA! Unified Particle Physics for Real-Time Applications [Macklin SIGGRAPH14] https://www.youtube.com/watch?v=z6daahlubzg 19

Collisions Another tricky issue Popular methods in PBD: For each voxel grid, record which particles it contains Test collisions only among nearby particles [Kaufman08] [Harmon09] [Zheng12] Recent method specialized for PBD 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] [Muller15] 20

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