1 Computer Graphics 15-462 Physical simulation for animation Case study: The jello cube The Jello Cube Mass-Spring System Collision Detection Integrators.

Slides:



Advertisements
Similar presentations
Forces Force is the cause of acceleration. It is defined as a push or a pull.
Advertisements

Ch 3.8: Mechanical & Electrical Vibrations
Blender Particle Fluids. Blender Particle Fluids integrate into the existent powerful Blender particle system a fluid simulation tool that allows a wide.
Chapter 5 Kinetic Energy
1cs533d-term Notes  Braino in this lecture’s notes about last lectures bending energy…
1Notes. 2 Building implicit surfaces  Simplest examples: a plane, a sphere  Can do unions and intersections with min and max  This works great for.
1Notes. 2 Triangle intersection  Many, many ways to do this  Most robust (and one of the fastest) is to do it based on determinants  For vectors a,b,c.
1Notes  Text:  Motion Blur A.3  Particle systems 4.5 (and 4.4.1, 6.6.2…)  Implicit Surfaces  Classic particle system papers  W. Reeves, “Particle.
MAT 594CM S10Fundamentals of Spatial ComputingAngus Forbes Week 2 : Dynamics & Numerical Methods Goal : To write a simple physics simulation Topics: Intro.
Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.
Interactive Animation of Structured Deformable Objects Mathieu Desbrun Peter Schroder Alan Barr.
Game Physics Chris Miles. The Goal To learn how to create game objects with realistic physics models To learn how to simulate aspects of reality in order.
1cs426-winter-2008 Notes  Course project: Will be due at the end of the term You can do it in pairs Create an animation that combines an algorithm for.
1cs533d-term Notes  list Even if you’re just auditing!
Cloth Simulation CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2005.
Manipulator Dynamics Amirkabir University of Technology Computer Engineering & Information Technology Department.
Physics 218: Mechanics Instructor: Dr. Tatiana Erukhimova Sections 818, 819, 820, 821 Lecture 10.
Particle Systems CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
1cs426-winter-2008 Notes  Sorry about missed classes  Assignment 2: matchmove and particles  Final project.
The Laws of Motion Unit 3 Presentation 1.
Collisions & Center of Mass Lecturer: Professor Stephen T. Thornton
Particle Systems Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
Chapter 4 The Laws of Motion. Forces Usually think of a force as a push or pull Usually think of a force as a push or pull Vector quantity Vector quantity.
Cloth Simulation CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2004.
Modeling, Simulating and Rendering Fluids Thanks to Ron Fediw et al, Jos Stam, Henrik Jensen, Ryan.
Computer graphics & visualization Rigid Body Simulation.
Module 1 Introduction to Ordinary Differential Equations Mr Peter Bier.
Simple Harmonic Motion
Vibrations and Waves Chapter 12.
Erin Catto Blizzard Entertainment Numerical Integration.
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
Simulating Electron Dynamics in 1D
Physically Based Modeling Let physics take over!.
Mass-Spring Systems Versatile Visualization Techniques Flexible Surfaces to Multidimensional Scaling Brian Duffy MSIM 742: Visualization II.
Simple Harmonic Motion
Mechanics Topic 2.2 Forces and Dynamics. Forces and Free-body Diagrams To a physicist a force is recognised by the effect or effects that it produces.
Springs We are used to dealing with constant forces. Springs are more complicated - not only does the magnitude of the spring force vary, the direction.
Scientific Computing Numerical Solution Of Ordinary Differential Equations - Euler’s Method.
Lecture Fall 2001 Physically Based Animation Ordinary Differential Equations Particle Dynamics Rigid-Body Dynamics Collisions.
Potential Energy ~March 1, 2006.
Advanced Computer Graphics Rigid Body Simulation Spring 2002 Professor Brogan.
MA/CS 375 Fall MA/CS 375 Fall 2002 Lecture 12.
University of Texas at Austin CS 378 – Game Technology Don Fussell CS 378: Computer Game Technology Physics for Games Spring 2012.
Exam 2 Review 8.02 W08D1. Announcements Test Two Next Week Thursday Oct 27 7:30-9:30 Section Room Assignments on Announcements Page Test Two Topics: Circular.
Introduction to Particle Simulations Daniel Playne.
Lecture 7 Newton’s Laws of Motion. Midterm Test #1 - Thursday!  21 multiple-choice problems - A calculator will be needed. - CHECK YOUR BATTERIES! -
Elastic Potential Energy Pg Spring Forces  One important type of potential energy is associated with springs and other elastic objects. In.
Spring 2002 Lecture #11 Dr. Jaehoon Yu 1.Center of Mass 2.Motion of a System of Particles 3.Angular Displacement, Velocity, and Acceleration 4.Angular.
Forces and Motion Unit Vocabulary. Newton’s 1 st law Law states: An object at rest stays at rest. An object in motion stays in motion unless an unbalanced.
Particle Systems. Applications Particle systems are broadly defined for: Explosion Cloth Fluid And more… It is integrated into many animation software,
More on Particles Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, March 24, 2004.
Lecture 40 Numerical Analysis. Chapter 7 Ordinary Differential Equations.
ECE 576 – Power System Dynamics and Stability Prof. Tom Overbye Dept. of Electrical and Computer Engineering University of Illinois at Urbana-Champaign.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Wednesday, June 20, 2007PHYS , Summer 2007 Dr. Jaehoon Yu 1 PHYS 1443 – Section 001 Lecture #12 Wednesday, June 20, 2007 Dr. Jaehoon Yu Impulse.
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Spring 2002 Lecture #18 Dr. Jaehoon Yu 1.Simple Harmonic Motion 2.Energy of the Simple Harmonic Oscillator 3.The Pendulum Today’s Homework Assignment.
Wednesday, Oct. 2, 2002PHYS , Fall 2002 Dr. Jaehoon Yu 1 PHYS 1443 – Section 003 Lecture #6 Wednesday, Oct. 2, 2002 Dr. Jaehoon Yu 1.Newton’s laws.
Lecture 6 Newton’s Laws of Motion. Exam #1 - next Thursday!  20 multiple-choice problems - No notes allowed; equation sheet provided - A calculator will.
Computer Graphics Imaging Ying Zhu Georgia State University Lecture 29 Soft Bodies and Rigid Bodies.
1 Physics: Chapter 4 Forces & the Laws of Motion Topics:4-1 Changes in Motion 4-2 Newton’s First Law 4-3 Newton’s Second & Third Laws 4-4 Everyday Forces.
PHY 151: Lecture Motion of an Object attached to a Spring 12.2 Particle in Simple Harmonic Motion 12.3 Energy of the Simple Harmonic Oscillator.
Computer Animation Ying Zhu Georgia State University
Semester Review Jeopardy.
Particle Systems Ed Angel
Computer Animation Algorithms and Techniques
Advanced Games Development Game Physics
PHYS 1443 – Section 501 Lecture #25
Presentation transcript:

1 Computer Graphics Physical simulation for animation Case study: The jello cube The Jello Cube Mass-Spring System Collision Detection Integrators The Jello Cube Mass-Spring System Collision Detection Integrators September

2 Computer Graphics Announcements Programming assignment 3 is out. It is due Tuesday, November 5th midnight. Midterm exam: –Next week on Thursday in class

3 Computer Graphics 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.

4 Computer Graphics Physical simulations Model nature by using the laws of physics Often, the only way to achieve realism Alternative: try various non-scientific tricks to achieve realistic effects Math becomes too complicated very quickly Isn’t it incredible that nature can compute everything (you, me, and the whole universe) on the fly, it is the fastest computer ever. Important issues: simulation accuracy and stability

5 Computer Graphics Simulation or real?

6 Computer Graphics 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

7 Computer Graphics Newton’s Laws Newton’s 2nd law: 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. Tells you how to compute acceleration, given the force and mass

8 Computer Graphics Single spring 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

9 Computer Graphics 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:

10 Computer Graphics 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 !!

11 Computer Graphics 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

12 Computer Graphics 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

13 Computer Graphics 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 networkStable networkNetwork out of control

14 Computer Graphics Solution: Structural, Shear and Bend Springs There will be three types of springs: –Structural –Shear –Bend Each has its own function

15 Computer Graphics 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.

16 Computer Graphics 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 A 3D cube (if you can’t see it immediately, keep trying) Shear spring (red) resists stretching and thus prevents shearing

17 Computer Graphics 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

18 Computer Graphics 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

19 Computer Graphics 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

20 Computer Graphics 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

21 Computer Graphics 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 v F Collision spring Boundary of colliding object

22 Computer Graphics 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

23 Computer Graphics Integrators (contd.) 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

24 Computer Graphics Integrators (contd.) 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)

25 Computer Graphics Integrator design issues Numerical stability –If time step too big, method “explodes” –t = 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

26 Computer Graphics Integrators (contd.) 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

27 Computer Graphics 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, ); 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 and check the bulletin board