Particle Systems Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.

Slides:



Advertisements
Similar presentations
M 1 and M 2 – Masses of the two objects [kg] G – Universal gravitational constant G = 6.67x N m 2 /kg 2 or G = 3.439x10 -8 ft 4 /(lb s 4 ) r – distance.
Advertisements

Gravitation Ch 5: Thornton & Marion. Introduction Newton, 1666 Published in Principia, 1687 (needed to develop calculus to prove his assumptions) Newton’s.
Force Force is a push or pull on an object The object is called the System Force on a system in motion causes change in velocity = acceleration Force is.
1 Computer Graphics Physical simulation for animation Case study: The jello cube The Jello Cube Mass-Spring System Collision Detection Integrators.
University of New Mexico
1Notes. 2Heightfields  Especially good for terrain - just need a 2d array of heights (maybe stored as an image)  Displacement map from a plane  Split.
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.
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.
Applications of Newton’s Laws
Mechanical Vibrations
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.
Department of Physics and Applied Physics , F2010, Lecture 12 Physics I LECTURE 12 10/18/10.
Numerical Solutions of Ordinary Differential Equations
Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Sampling and Aliasing Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
1 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Shading I Ed Angel Professor of Computer Science, Electrical and Computer Engineering,
Electrical & Gravitational Force. Newton’s Universal Law of Gravitation Every object in the universe attracts every other object with a force that for.
TOPIC 6: Fields and Forces. What is gravity? Is there gravity in space? Why do astronauts float? What keeps the moon from flying off in space?
Procedural Methods (with a focus on particle systems) Angel, Chapter 11 slides from AW, open courseware, etc. CSCI 6360/4360.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Newton’s Law of Gravitation. Newton concluded that gravity was a force that acts through even great distances Newton did calculations on the a r of the.
TOPIC 6.1: Gravitational Fields and Forces These notes were typed in association with Physics for use with the IB Diploma Programme by Michael Dickinson.
CS559: Computer Graphics Lecture 38: Animation Li Zhang Spring 2008 Slides from Brian Curless at U of Washington.
Physically Based Modeling Let physics take over!.
How we know what we know An introduction into orbital mechanics Matt Hamill.
Equation of Motion for a Particle Sect nd Law (time independent mass): F = (dp/dt) = [d(mv)/dt] = m(dv/dt) = ma = m(d 2 r/dt 2 ) = m r (1) A 2.
Scientific Computing Numerical Solution Of Ordinary Differential Equations - Euler’s Method.
Calculus and Newton’s 2 nd Law Sometimes, we want to find a formula for the velocity (or position) of an object as a function of time. 公式.
Introduction to Procedural Methods, Particles Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Monday, March.
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.
Introduction to Particle Simulations Daniel Playne.
Slides for Parallel Programming Techniques & Applications Using Networked Workstations & Parallel Computers 2nd ed., by B. Wilkinson & M
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
ES 240: Scientific and Engineering Computation. Chapter 1 Chapter 1: Mathematical Modeling, Numerical Methods and Problem Solving Uchechukwu Ofoegbu Temple.
Law of Universal Gravitation. Newton’s Universal Law of Gravity Legend has it that Newton was struck on the head by a falling apple while napping under.
Perpetual Visualization of Particle Motion and Fluid Flow Presented by Tsui Mei Chang.
PHY115 – Sault College – Bazlurslide 1 Gravitational Force.
1 Two of Newton’s Law of Motions 1) In the absence of any forces applied, an object at rest will stay at rest, and a body moving at a constant velocity.
Application of Perturbation Theory in Classical Mechanics
More on Particles Glenn G. Chappell U. of Alaska Fairbanks CS 481/681 Lecture Notes Wednesday, March 24, 2004.
Game Technology Animation V Generate motion of objects using numerical simulation methods Physically Based Animation.
Bump Mapping Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of.
MECHANICS Ms. Peace Introduction. Sequence 1.1 What is Mechanics? 1.1 What is Mechanics? 1.2 Fundamental Concepts and Principles 1.2 Fundamental Concepts.
What is the centripetal force acting on a 2000 kilogram airplane if it turns with a radius of 1000 meters while moving at 300 meters per second? a c =
What is gravity? GalileoGalileo and Newton gave the name Newton GalileoNewton gravity to the force that exists between the Earth and objects. Newton showed.
Central Force Umiatin,M.Si. The aim : to evaluate characteristic of motion under central force field.
Part 1 Chapter 1 Mathematical Modeling, Numerical Methods, and Problem Solving PowerPoints organized by Dr. Michael R. Gustafson II, Duke University and.
Newton’s Law of Universal Gravitation
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.
Fall 2011 PHYS 172: Modern Mechanics Lecture 4 – Physical Models, Fundamental Interactions Read 2.7–2.8,
Newton’s Law of Gravitation Definition of Newton’s Law of Gravitation: The gravitational force between two bodies is directly proportional to the product.
Advanced Computer Graphics Rigid Body Simulation
Particle Systems Ed Angel Professor Emeritus of Computer Science
Unit 2: Forces in Physics
Ch 7 Objective Warm-Up You will learn about circular acceleration and Force You will learn to use Newton’s Universal Gravitation formula You will learn.
Newton’s Law of Gravity
3.1 Force of Gravity.
Chapter 4 Laws of Motion.
Particle Systems.
Introduction.
Manipulator Dynamics 2 Instructor: Jacob Rosen
Motion in Real and Virtual Worlds
Universal Gravitation
Particle Systems Ed Angel
Universal Gravitation
Newton’s Law of Universal Gravitation
Particle Systems.
Presentation transcript:

Particle Systems Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University of New Mexico

2 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Introduction Most important of procedural methods Used to model ­Natural phenomena Clouds Terrain Plants ­Crowd Scenes ­Real physical processes

3 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Newtonian Particle Particle system is a set of particles Each particle is an ideal point mass Six degrees of freedom ­Position ­Velocity Each particle obeys Newtons’ law f = ma

4 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Particle Equations p i = (x i, y i z i ) v i = dp i /dt = p i ‘ = (dx i /dt, dy i /dt, z i /dt) m v i ‘ = f i Hard part is defining force vector

5 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Force Vector Independent Particles ­Gravity ­Wind forces ­O(n) calulation Coupled Particles O(n) ­Meshes ­Spring-Mass Systems Coupled Particles O(n 2 ) ­Attractive and repulsive forces

6 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Solution of Particle Systems float time, delta state[6n], force[3n]; state = initial_state(); for(time = t0; time<final_time, time+=delta) { force = force_function(state, time); state = ode(force, state, time, delta); render(state, time) }

7 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Simple Forces Consider force on particle i f i = f i (p i, v i ) Gravity f i = g g i = (0, -g, 0) Wind forces Drag p i (t 0 ), v i (t 0 )

8 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Meshes Connect each particle to its closest neighbors ­O(n) force calculation Use spring-mass system

9 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Spring Forces Assume each particle has unit mass and is connected to its neighbor(s) by a spring Hooke’s law: force proportional to distance (d = ||p – q||) between the points

10 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Hooke’s Law Let s be the distance when there is no force f = -k s (|d| - s) d/|d| k s is the spring constant d/|d| is a unit vector pointed from p to q Each interior point in mesh has four forces applied to it

11 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Spring Damping A pure spring-mass will oscillate forever Must add a damping term f = -(k s (|d| - s) + k d d·d/|d|)d/|d| Must project velocity ·

12 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Attraction and Repulsion Inverse square law f = -k r d/|d| 3 General case requires O(n 2 ) calculation In most problems, the drop off is such that not many particles contribute to the forces on any given particle Sorting problem: is it O(n log n)?

13 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Boxes Spatial subdivision technique Divide space into boxes Particle can only interact with particles in its box or the neighboring boxes Must update which box a particle belongs to after each time step

14 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Linked Lists Each particle maintains a linked list of its neighbors Update data structure at each time step Must amortize cost of building the data structures initially

15 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Particle Field Calculations Consider simple gravity We don’t compute forces due to sun, moon, and other large bodies Rather we use the gravitational field Usually we can group particles into equivalent point masses

16 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Solution of ODEs Particle system has 6n ordinary differential equations Write set as du/dt = g(u,t) Solve by approximations using Taylor’s Thm

17 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Euler’s Method u(t + h) ≈ u(t) + h du/dt = u(t) + hg(u, t) Per step error is O(h 2 ) Require one force evaluation per time step Problem is numerical instability depends on step size

18 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Improved Euler u(t + h) ≈ u(t) + h/2(g(u, t) + g(u, t+h)) Per step error is O(h 3 ) Also allows for larger step sizes But requires two function evaluations per step Also known as Runge-Kutta method of order 2

19 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Contraints Easy in computer graphics to ignore physical reality Surfaces are virtual Must detect collisions separately if we want exact solution Can approximate with repulsive forces

20 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Collisions Once we detect a collision, we can calculate new path Use coefficient of resititution Reflect vertical component May have to use partial time step

21 Angel: Interactive Computer Graphics 4E © Addison-Wesley 2005 Contact Forces