The jello cube. Undeformed cube. Deformed cube

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

Physical simulation for animation

Physically Based Simulation

Physically Based Simulation

Modeling Cloth Using Mass Spring Systems

Mass-Spring Systems. Last Time?

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

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

Cloth Simulation. COMP 768 Presentation Zhen Wei

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

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

PHYSICALLY BASED ANIMATION

Physically based modelling Computer Graphics I February 27, 2003

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

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

Fundamentals of Computer Animation

Simulation: Particle Systems

Real Time Cloth Simulation

A Fast and Stable Approach for Restoration of Warped Document Images

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

Soft Body. 9.7 Physics - Soft Body

Animation. Itinerary. What is Animation? What is Animation? Animation Methods. Modeling vs. Animation Computer Graphics Lecture 22

Animation. Itinerary Computer Graphics Lecture 22

CS205b/CME306. Lecture 9

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

Fracture & Tetrahedral Models

Particle Systems. Lecture 8 Taku Komura

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

ROSE-HULMAN INSTITUTE OF TECHNOLOGY

Cloth Hair. and. soft bodies

CS 231. Deformation simulation (and faces)

How To Implement a Pressure Soft Body Model

Development of the Compliant Mooring Line Model for FLOW-3D

Tutorial: Getting Started with the LabVIEW Simulation Module

CS 231. Deformation simulation (and faces)

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

Cloth Animation with Collision Detection

Fig [1] Fig v =...[4]

PSE Game Physics. Session (3) Springs, Ropes, Linear Momentum and Rotations. Oliver Meister, Roland Wittmann

Discrete Element Method

Auto Injector Syringe. A Fluent Dynamic Mesh 1DOF Tutorial

CS-184: Computer Graphics. Today

Example 24 Spring-back

Simulation of curly hair

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

ROBOTICS 01PEEQW. Basilio Bona DAUIN Politecnico di Torino

Anatomy of a Physics Engine. Erwin Coumans

Announcements. Ray tracer is due in five days you should have started by now or you re going to have a bad week. Missing file posted on the web page

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

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

CLOTH - MODELING, DEFORMATION, AND SIMULATION

Finite difference methods

Animation and Ray Tracing

Physics Tutorial 2: Numerical Integration Methods

Particle Systems. g(x,t) x. Reading. Particle in a flow field. What are particle systems? CSE 457 Winter 2014

Lesson 1: Introduction to Pro/MECHANICA Motion

Realistic Animation of Fluids

Cloth Simulation. Elaine Kieran (d ) Gavin Harrison (d ) Luke Openshaw (d ) MSc Computer Animation NCCA Bournemouth University

An Analysis of Interactive Deformable Solid Object Modeling

Rigid Body Dynamics, Fracture, & Deformation

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

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

Numerical Integration

Cloth The Animation of Natural Phenomena Adrien Treuille

Navier-Stokes & Flow Simulation

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

5/27/12. Objectives 7.1. Area of a Region Between Two Curves. Find the area of a region between two curves using integration.

Cloth Simulations. 9.2 Physics - Cloth Simulations

Development of Equipment Performance Visualization Techniques Based on Distinct Element Method (DEM)

8 Tutorial: The Slider Crank Mechanism

LECTURE 37: Ray model of light and Snell's law

Chapter 6 Visualization Techniques for Vector Fields

MATH2071: LAB 2: Explicit ODE methods

Motion Capture & Simulation

State Estimation and Parameter Identification of Flexible Manipulators Based on Visual Sensor and Virtual Joint Model

Comparing Efficiency of Integration Methods for Cloth Simulation

Discontinuous Galerkin Sparse Grid method for Maxwell s equations

Elastic Bands: Connecting Path Planning and Control

Navier-Stokes & Flow Simulation

CHAPTER 3. Elementary Fluid Dynamics

Application of Computational MBD for Simulation of Wrap Packaging Performance

Computer Animation. Algorithms and Techniques. z< MORGAN KAUFMANN PUBLISHERS. Rick Parent Ohio State University AN IMPRINT OF ELSEVIER SCIENCE

MAJOR IMPROVEMENTS IN STORES SEPARATION ANALYSIS USING FLEXIBLE AIRCRAFT

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

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

Visualization. CSCI 420 Computer Graphics Lecture 26

Beams. Lesson Objectives:

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

CS-184: Computer Graphics. Today. Lecture #20: Spring and Mass systems. 20-SpringMassSystems.key - April 23, Spring and Mass systems

CS-184: Computer Graphics. Today. Lecture #22: Spring and Mass systems. Spring and Mass systems. Distance springs Spring dampers Edge springs

Ordinary Differential Equations

Revision of the SolidWorks Variable Pressure Simulation Tutorial J.E. Akin, Rice University, Mechanical Engineering. Introduction

Name: SID: LAB Section:

Flexible multibody systems - Relative coordinates approach

PERFORM-3D Version Copyright Computers and Structures, Inc., 2011 Release Date:

SIMULATION OF ELASTIC SOFT TISSUE DEFORMATION IN ORTHODONTICS BY MASS-SPRING SYSTEM

Math 225 Scientific Computing II Outline of Lectures

CITY AND GUILDS 9210 UNIT 135 MECHANICS OF SOLIDS Level 6 TUTORIAL 15 - FINITE ELEMENT ANALYSIS - PART 1

Galileo s Investigation

Directional Constraint Enforcement for Fast Cloth Simulation

Transcription:

The Jello Cube Assignment 1, CSCI 520 Jernej Barbic, USC Undeformed cube The jello cube Deformed cube The jello cube is elastic, Can be bent, stretched, squeezed,, Without external forces, it eventually restores to the original shape. Mass-Spring System Several mass points Connected to each other by springs Springs expand and stretch, exerting force on the mass points Very often used to simulate cloth Examples: A 2-particle spring system Another 2-particle example Cloth animation example 1 2 3 Newton s 2nd law: Newton s Laws Tells you how to compute acceleration, given the force and mass Newton s 3rd law: If object A exerts a force F on object B, then object B is at the same time exerting force -F on A. Obeys the Hook s law: F = k (x - x 0 ) x 0 = rest length k = spring elasticity (aka stiffness) For x<x 0, spring wants to extend For x>x 0, spring wants to contract Single spring Hook s law in 3D Assume A and B two mass points connected with a spring. Let L be the vector pointing from B to A Let R be the spring rest length Then, the elastic force exerted on A is: 4 5 6 1

Damping Springs are not completely elastic They absorb some of the energy and tend to decrease the velocity of the mass points attached to them Damping force depends on the velocity: k d = damping coefficient k d different than k Hook!! 7 Damping in 3D Assume A and B two mass points connected with a spring. Let L be the vector pointing from B to A Then, the damping force exerted on A is: Here v A and v B are velocities of points A and B Damping force always OPPOSES the motion 8 A network of springs Every mass point connected to some other points by springs Springs exert forces on mass points Hook s force Damping force Other forces External force field» Gravity» Electrical or magnetic force field Collision force 9 How to organize the network (for jello cube) To obtain stability, must organize the network of springs in some clever way Jello cube is a 8x8x8 mass point network 512 discrete points Must somehow connect them with springs Basic network Stable network Network out of control Solution: Structural, Shear and Bend Springs There will be three types of springs: Structural Shear Bend Each has its own function Structural springs Connect every node to its 6 direct neighbours Node (i,j,k) connected to (i+1,j,k), (i-1,j,k), (i,j-1,k), (i,j+1,k), (i,j,k-1), (i,j,k+1) (for surface nodes, some of these neighbors might not exists) Structural springs establish the basic structure of the jello cube The picture shows structural springs for the jello cube. Only springs connecting two surface vertices are shown. 10 11 12 2

Shear springs Disallow excessive shearing Prevent the cube from distorting Every node (i,j,k) connected to its diagonal neighbors Structural springs = white Shear springs = red Shear spring (red) resists stretching and thus prevents shearing A 3D cube (if you can t see it immediately, keep trying) Bend springs Prevent the cube from folding over Every node connected to its second neighbor in every direction (6 connections per node, unless surface node) white=structural springs yellow=bend springs (shown for a single node only) Bend spring (yellow) resists contracting and thus prevents bending External force field If there is an external force field, add that force to the sum of all the forces on a mass point There is one such equation for every mass point and for every moment in time 13 14 15 Collision detection The movement of the jello cube is limited to a bounding box Collision detection easy: Check all the vertices if any of them is outside the box Inclined plane: Equation: Initially, all points on the same side of the plane F(x,y,z)>0 on one side of the plane and F(x,y,z)<0 on the other Can check all the vertices for this condition Collision response When collision happens, must perform some action to prevent the object penetrating even deeper Object should bounce away from the colliding object Some energy is usually lost during the collision Several ways to handle collision response We will use the penalty method The penalty method When collision happens, put an artificial collision spring at the point of collision, which will push the object backwards and away from the colliding object Collision springs have elasticity and damping, just like ordinary springs Boundary of colliding object F v 16 17 Collision spring 18 3

Boundary of colliding object Collision spring F Penalty force Direction is normal to the contact surface Magnitude is proportional to the amount of penetration Collision spring rest length is zero Integrators Network of mass points and springs Hook s law, damping law and Newton s 2nd law give acceleration of every mass point at any given time F = ma Hook s law and damping provide F m is point mass The value for a follows from F=ma Now, we know acceleration at any given time for any point Want to compute the actual motion The equations of motion: x = point position, v = point velocity, a = point acceleration They describe the movement of any single mass point F hook =sum of all Hook forces on a mass point F damping = sum of all damping forces on a mass point 19 20 21 When we put these equations together for all the mass points, we obtain a system of ordinary differential equations. In general, impossible to solve analytically Must solve numerically Methods to solve such systems numerically are called integrators Most widely used: Euler Runge-Kutta 2nd order (aka the midpoint method) (RK2) Runge-Kutta 4th order (RK4) Integrator design issues Numerical stability If time step too big, method explodes t = 0.001 is a good starting choice for the assignment Euler much more unstable than RK2 or RK4» Requires smaller time-step, but is simple and hence fast Euler rarely used in practice Numerical accuracy Smaller time steps means more stability and accuracy But also means more computation Computational cost Tradeoff: accuracy vs computation time RK4 is often the method of choice RK4 very popular for engineering applications The time step should be inversely proportional to the square root of the elasticity k [Courant condition] For the assignment, we provide the integrator routines (Euler, RK4) void Euler(struct world * jello); void RK4(struct world * jello); Calls to there routines make the simulation progress one time-step further. State of the simulation stored in jello and automatically updated 22 23 24 4

Tips Use double precision for all calculations (double) Do not overstretch the z-buffer It has finite precision Ok: gluperspective(90.0,1.0,0.01,1000.0); Bad: gluperspective(90.0,1.0,0.0001,100000.0); Choosing the right elasticity and damping parameters is an art Trial and error For a start, can set the ordinary and collision parameters the same Read the webpage for updates 25 5