Cloth Hair. and. soft bodies

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

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

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

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

PHYSICALLY BASED ANIMATION

Cloth Simulation. COMP 768 Presentation Zhen Wei

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

Cloth and Hair Collisions

Mass-Spring Systems. Last Time?

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

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

Physically Based Simulation

Physically Based Simulation

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

CS 231. Deformation simulation (and faces)

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

Simulation of curly hair

Cloth Animation with Collision Detection

Support for Multi physics in Chrono

The jello cube. Undeformed cube. Deformed cube

QP-Collide: A New Approach to Collision Treatment

2.11 Particle Systems

Modeling Cloth Using Mass Spring Systems

Topics in Computer Animation

Auto Injector Syringe. A Fluent Dynamic Mesh 1DOF Tutorial

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

Meshless Modeling, Animating, and Simulating Point-Based Geometry

Module 4: Fluid Dynamics Lecture 9: Lagrangian and Eulerian approaches; Euler's acceleration formula. Fluid Dynamics: description of fluid-motion

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

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

Particle Systems. Lecture 8 Taku Komura

A Fast and Stable Approach for Restoration of Warped Document Images

Lecture VI: Constraints and Controllers. Parts Based on Erin Catto s Box2D Tutorial

Example 24 Spring-back

Realtime Water Simulation on GPU. Nuttapong Chentanez NVIDIA Research

CS 231. Deformation simulation (and faces)

Guidelines for proper use of Plate elements

Navier-Stokes & Flow Simulation

Constraint fluids in Sprinkle. Dennis Gustafsson Mediocre

A brief introduction to fluidstructure. O. Souček

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

Real-Time Simulation of Deformation and Fracture of Stiff Materials

SAMCEF for ROTORS. Chapter 3.2: Rotor modeling. This document is the property of SAMTECH S.A. MEF A, Page 1

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

DYNAMIC SIMULATION OF INEXTENSIBLE CLOTH

Simulation of Fuel Sloshing Comparative Study

Cloth The Animation of Natural Phenomena Adrien Treuille

Application of Finite Volume Method for Structural Analysis

Lecture VI: Constraints and Controllers

Particle-based Fluid Simulation

Project 1. Has been posted! Previous year projects:

THE development of stable, robust and fast methods that

Position Based Dynamics for Character Effects

Navier-Stokes & Flow Simulation

Ragdoll Physics. Abstract. 2 Background. 1 Introduction. Gabe Mulley, Matt Bittarelli. April 25th, Previous Work

Fluid-Structure-Interaction Using SPH and GPGPU Technology

Polygonal Mesh. Geometric object made of vertices, edges and faces. Faces are polygons. Polyhedron. Triangular mesh Quad mesh. Pyramid Cube Sphere (?

Overview of Traditional Surface Tracking Methods

A New Self-Collision Detection Method for Cloth Simulation

Finite Element Method. Chapter 7. Practical considerations in FEM modeling

Fracture & Tetrahedral Models

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

Parallel GPU-Based Fluid Animation. Master s thesis in Interaction Design and Technologies JAKOB SVENSSON

Physically based modelling Computer Graphics I February 27, 2003

SPH: Why and what for?

Sand Simulation. Abhinav Golas. COMP Physically Based Simulation. Final Project Presentation. May 6,

Hair Simulation (and Rendering)

Acknowledgements. Prof. Dan Negrut Prof. Darryl Thelen Prof. Michael Zinn. SBEL Colleagues: Hammad Mazar, Toby Heyn, Manoj Kumar

DYNAMICS FOR ANIMATION. Rémi Ronfard, Animation, M2R MOSIG

IMPROVED WALL BOUNDARY CONDITIONS WITH IMPLICITLY DEFINED WALLS FOR PARTICLE BASED FLUID SIMULATION

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

Adarsh Krishnamurthy (cs184-bb) Bela Stepanova (cs184-bs)

[3] Rigid Body Analysis

Cloth Simulation on the GPU. Cyril Zeller NVIDIA Corporation

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

Divergence-Free Smoothed Particle Hydrodynamics

Engineering Effects of Boundary Conditions (Fixtures and Temperatures) J.E. Akin, Rice University, Mechanical Engineering

Smoke Simulation using Smoothed Particle Hydrodynamics (SPH) Shruti Jain MSc Computer Animation and Visual Eects Bournemouth University

Computer Graphics Ray Casting. Matthias Teschner

Real-Time Simulation of Deformation and Fracture of Stiff Materials

9. Representing constraint

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

Characteristic Aspects of SPH Solutions

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

The 3D DSC in Fluid Simulation

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

Modelling of Impact on a Fuel Tank Using Smoothed Particle Hydrodynamics

Chapter 13 - Modifiers

Unstructured Mesh Generation for Implicit Moving Geometries and Level Set Applications

A Geometric Approach to Animating Thin Surface Features in SPH Water

Animation of Fluids. Animating Fluid is Hard

PPGCC Linha de Pesquisa SIV Disciplina: Animação Computadorizada. Profª. Drª. Soraia Raupp Musse Pós-doc Dr Leandro Dihl 12/05/2015

Applications. Human and animal motion Robotics control Hair Plants Molecular motion

Generative Part Structural Analysis Fundamentals

Non-Rigid Image Registration III

Intuitive Control of Dynamic Simulation Using Improved Implicit Constraint Enforcement

Solidification using Smoothed Particle Hydrodynamics

Fluid-structure Interaction by the mixed SPH-FE Method with Application to Aircraft Ditching

Interactive Real Time Cloth Simulation with Adaptive Level of Detail

Soft Body. 9.7 Physics - Soft Body

Transcription:

Cloth Hair Lesson 11 and soft bodies

Lesson 08 Outline Problem definition and motivations Modeling deformable solids with mass-spring model Position based dynamics Modeling cloths with mass-spring model Modeling hair with mass-spring model Demos / tools / libs

Simulation of Deformable Solids Lagrangian Mesh Based Methods Continuum Mechanics Based Methods Mass-Spring Systems Lagrangian Mesh Free Methods Loosely Coupled Particle Systems Smoothed Particle Hydrodynamics (SPH) Mesh Free Methods for the solution of PDEs Reduced Deformation Models and Modal Analysis Eulerian and Semi-Lagrangian Methods Fluids and Gases Melting Objects

Mass-spring Model

Mass-spring Model Each deformable solid is modeled as a graph (mesh) of particles (with mass) connected with mass-less springs Particle Model Each particle is defined at least by its Mass (mi), Position (pi), Velocity (vi) Additionally there can be force, acceleration, momentum Usually particles can be incident to any number of springs Spring Model Springs usually connects 2 particles and exerts force on them Usually sprigs have non-zero rest length and some constant material properties

Hook's Spring Model Hook's Law: Strain is directly proportional to stress Formally: f = - ks x x is the displacement of the end of the spring from its equilibrium position f is the restoring force exerted by the material k is a material constant called spring stiffness s Using rest length and velocity damping f = - [ks( l l0) + kd(va - vb)/ l ] (l/ l ) kd is damping factor a l0 x = l - l0 f = - ks x b

Position based Dynamics

Position based Dynamics Traditional force based dynamics must solve ODE using some integration scheme. Using simple and fast explicit methods can lead simulation to inaccuracy and instability This can be prevented by solving large systems of equations (using implicit methods) or Using more geometric approach by directly modify positions into stable and more accurate states. Such approach (position based dynamics) gives more control over animation and easily models constraints.

Position based Dynamics Object Representation We represent dynamic object with a set N vertices Each vertex has: Mass (m ), Position (p ), velocity (v ) i i i Constraint Representation Let p = (p1,, pn) be the generalized position The constraint is a functions Cj(p) = Cj(p1,, pn): R3N R Cardinality mj is the number of used parameters Stiffness parameter kj {0 1} is a material property We define equality (bilateral) constraint as: Cj(p) = 0 We define inequality (unilateral) constraint as: Cj(p) 0

PBD: Algorithm 1: forall vertices i: initialize pi = pi0; vi = vi0; wi = 1/mi 2: loop 3: forall vertices i do { vi vi + Δt wi fext(xi) } 4: DampVelocities(v1,, vn) 5: forall vertices i do { qi pi + Δt vi } 6: forall vertices i do { CreateCollisionConstraints(xi pi) } 7: loop ns times { ProjectConstraints(C1,, CM+Q, q1,, qn) } 8: forall vertices I do { vi (qi pi)/δt; pi qi; } 9: VelocityUpdate(v1,, vn) 10: endloop

PBD: Algorithm First all masses, positions and velocities are initialized to rest state With each simulation frame we do First we modify velocities due to external forces (3:) Next we add artificial damping to the system (4:) Then we predict new positions (q ) with simple Euler step (5:) i Next we detect and construct all collision constraints (6:) We apply projection several times on all constraints (7:) We find correct velocities and set projected positions (8:) We apply friction and restitution impulses on velocities (9:)

PBD: Constraint Projection Assuming constraint is violated ie. C(p)!= 0 (<0) we must find correction Δp such that C(p + Δp) = 0 ( 0) By linearization we get: C(p+Δp) C(p) + pc(p) Δp To conserve both momentums correction must be along direction of constraint function gradient pc(p) ie: Δp = λ pc(p); λ (Lagrange multiplier) is a scalar λ = - C(p) / pc(p) 2f For i-th particle with mass mi (wi = 1/mi) Δpi = λ wi pc(p1,, pn) λ = - wi C(p1,, pn) / jwj pjc(p1,, pn) 2

PBD: Distance Constraint Let C(p) = C(p1, p2) = p1 p2 - d = 0 p1c(p1, p2) = (p1 p2)/ p1 p2 p2c(p1, p2) = (p1 p2)/ p1 p2 λ = ( p1 p2 - d) / w1 + w2 Δp1 = (w1 / (w1 + w2))( p1 p2 - d)(p1 p2)/ p1 p2 Δp2 = (w2 / (w1 + w2))( p1 p2 - d)(p1 p2)/ p1 p2 where w1 = 1/m1 and w2 = 1/m2 For equality constraints we always do projection For Inequality we project only when C(p) < 0 Finally we multiply Δp with stiffness k ( Δpk ) Due to iterations use k' = 1 (1 k)1/ns. Stiffness is applied linearly after ns iterations

PBD: Collisions Given old position pi and predicted position qi we detect if a ray (pi, qi) enters some object. If yes we compute entry point qc and collision normal nc Next add collision constraint with stiffness k = 1 C(p) = (p qc) nc 0 (ensures non-penetration) When scene contains more dynamic bodies we must provide constraint from all bodies into one scene solver For triangle meshes with face (p, p, p ): n = (p - p ) x (p - p ) 1 2 3 c 2 1 3 1 Collision constraint generation is done outside the solver loop, to speed up simulation. Artifacts are negligible

PBD: Damping Velocities are damped forall vertices i Global body variables pcm = ( i pi mi)/( i mi) Δvi = vcm + ω x ri - vi vcm = ( i vi mi)/( i mi) vi vi + kdδvi L = iri x (mivi) J = i(rxi)(rxi)t mi endfor Δvi only damps local deviations Here vcm + ω x ri is the velocity due to global body motion ω = J-1 L r = p pi i cm rxi is cross product matrix

Position based Dynamics - Summary Control over explicit integration with no typical instability problems Positions of vertices and objects parts can directly be manipulated during the simulation Simple handling of general constraints in the position based setting The explicit position based solver is easy to understand and implement.

Modeling Cloth

Cloth: Representation Cloth is represented with arbitrary manifold triangular mesh (no need for regular lattice) Each mesh vertex become a simulation particle Given cloth density and thickness we calculate mass of each triangle. Mass of each particle is sum of 1/3 of the mass of each adjacent triangle. Constraints are defined along edges and faces Cloth tearing is performed on vertices with large deformations

Cloth: Constraints Stretching Constraints Along each mesh edge we define fixed stretching constraint as simple equality distance constraint (spring) C (p, p ) = p p l where l0 is rest length s 1 2 1 2 0 Stiffness ks is usually higher to overcome springiness Bending Constraints For each pair of adjacent triangles (p1, p3, p2) and (p1, p2, p4) we define a bending constraint C (p, p, p, p )= acos(n, n ) φ where b 1 2 3 4 1 2 0 p2 n1 n1 = ((p2 - p1) x (p3 - p1)) / (p2 - p1) x (p3 p1) n2 = ((p2 - p1) x (p4 - p1)) / (p2 - p1) x (p4 p1) p4 p1 p3 n2

Cloth: Collisions and Tearing Inequality collision constraints is defined as Cb(q, p1, p2, p3) = (q p1) n h q is collided point with face (p1, p2, p3) n is face normal h distance to the face. Collision with rigid body exerts impulse mipi/δt at pi More involved self-collision detection must be done cloth becomes to be tangled

Cloth: Overpressure and Tear Overpressure inside the closed mesh is modeled as C(p1,, pn) = j(pj1 x pj2) pj3 kpv0 p1c = j(pj2 x pj3) + j(pj3 x pj1) + j(pj1 x pj2) Cloth Tearing Process Whenever the stretching of an edge exceeds a specified threshold value, we select one of the edge s adjacent vertices We then put a split plane through that vertex perpendicular to the edge direction and split the vertex into 2 new vertices All triangles above the split plane are assigned to the original vertex while all triangles below are assigned to the duplicate

Cloth: Stiffness and Bending (ks; kb) = (1; 1) (ks; kb) = (0.5; 1) (ks; kb) = (1; 0) (ks; kb) = (0.5; 0) (ks; kb) = (0.01; 1) (ks; kb) = (0.01; 0)

Cloth: Self Collisions and Balloons

Cloth: Examples

Modeling Hair

Hair: Representation Each hair strand is modeled as a set of vertices connected by edges into series of line segments Each vertex is used as simulation particle Given material density and strand thickness we can calculate volume/mass of each segment. Particle mass is average of incident edge masses Strand constraints are applied along edges, additional (virtual) edges and newly created particles Hair tearing is performed on vertices with large deformations

Hair: Constraints We model Curly Hair and Straight Hair Stretching Constraints (springs) Linear springs between every consecutive particle Bending Constraints (springs) Linear springs between every other particle The edge springs and bending springs together form triangles that implicitly represent the orientation of the hair Torsion Constraints (springs) Twist is modeled by attaching torsion springs that connect each particle to a particle three particles away from it Altitude Constraints (springs) See figure

Hair: Altitude Springs Point/Face Altitude Springs Perpendicular to the face starting from the given point Length is l = 6V/ u x v where u and v are the vectors of the base triangle and V is the signed volume of the tetrahedron Edge/Edge Altitude Springs Perpendicular to common spring and bending spring Length is l = 6V/ u x v where u and v are the stretch and bend spring and V is the signed volume of the tetrahedron For any tetrahedron, the edge/edge or point/face spring with minimal length is guaranteed to have all non-negative barycentric weights, preventing unbounded forces

Hair: Linear Strands

Hair: Curly Strands

The End