Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012.

Slides:



Advertisements
Similar presentations
Time averages and ensemble averages
Advertisements

Real-Time Game Physics
Motivation Hair animation used in movies, games, virtual reality, etc. Problem due to complexity –Human head has over 100,000 strands of hair –Computation.
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.
1. What is Lighting? 2 Example 1. Find the cubic polynomial or that passes through the four points and satisfies 1.As a photon Metal Insulator.
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.
1Notes  Textbook: matchmove 6.7.2, B.9. 2 Match Move  For combining CG effects with real footage, need to match synthetic camera to real camera: “matchmove”
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 and Fuzzy Shapes Presented by Dan Cogswell.
Applications of Newton’s Laws
Particle Systems GPU Graphics. Sample Particle System Fire and SmokeWater.
AOSS 321, Winter 2009 Earth System Dynamics Lecture 6 & 7 1/27/2009 1/29/2009 Christiane Jablonowski Eric Hetland
Modeling Fluid Phenomena -Vinay Bondhugula (25 th & 27 th April 2006)
1cs426-winter-2008 Notes  Sorry about missed classes  Assignment 2: matchmove and particles  Final project.
Particle Systems Ed Angel Professor of Computer Science, Electrical and Computer Engineering, and Media Arts Director, Arts Technology Center University.
1cs426-winter-2008 Notes. 2 Velocity fields  Velocity field could be a combination of pre-designed velocity elements E.g. explosions, vortices, …  Or.
Computer graphics & visualization Rigid Body Simulation.
Classical Mechanics Describes the relationship between the motion of objects in our everyday world and the forces acting on them Conditions when Classical.
Physically Based Animation and Modeling
Procedural Methods (with a focus on particle systems) Angel, Chapter 11 slides from AW, open courseware, etc. CSCI 6360/4360.
Universal Gravitation
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!.
Particle Systems – Technique for Modeling a Class of Fuzzy Objects Craig Schroeder Computer Graphics I April 22, 2004.
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.
CSC505 Particle Systems. CSC505 Object Representations So far we have represented (rendered) objects with –Lines –Polygons (triangles) –Curves These techniques.
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.
1 Perception and VR MONT 104S, Fall 2008 Lecture 21 More Graphics for VR.
Particle Systems (Motion Machines of 2D Objects with Textures) Matthew K. Bowles Advanced Computer Graphics Spring 2004.
University of British Columbia CPSC 314 Computer Graphics Jan-Apr 2005 Tamara Munzner Procedural Approaches.
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.
Particles Paul Taylor Polygons are not so hot! Good for representing objects like A Cup A Robot A Pyramid Not so hot for creating Hair Snowflakes.
1 Introduction to Computer Graphics with WebGL Ed Angel Professor Emeritus of Computer Science Founding Director, Arts, Research, Technology and Science.
Chapter 7 Rotational Motion and The Law of Gravity.
Data Visualization Fall 2015.
MA354 An Introduction to Math Models (more or less corresponding to 1.0 in your book)
Multimedia Programming 21: Particle Animation Departments of Digital Contents Sang Il Park.
Perpetual Visualization of Particle Motion and Fluid Flow Presented by Tsui Mei Chang.
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.
Graphics Lecture 17: Slide 1 Interactive Computer Graphics Lecture 17: Fire.
Particles and their home in Geometry Shaders Paul Taylor 2010.
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.
Advanced Games Development Game Physics CO2301 Games Development 1 Week 19.
Particle Systems Reference: Reeves W.: "Particle Systems -- A Technique for Modelling a Class of Fuzzy Objets", Computer Graphics, 17(3), pp ,
Central Force Umiatin,M.Si. The aim : to evaluate characteristic of motion under central force field.
Dynamics. Motion with Regard to Mass Particle Dynamics Mass concentrated in point Newton’s Equation Governs Motion f = M x.
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.
Advanced Computer Graphics Rigid Body Simulation
Particle Systems Ed Angel Professor Emeritus of Computer Science
CHAPTER 4: Systems of Particles
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.
© University of Wisconsin, CS559 Fall 2004
Algorithmic Animation & Particle Systems
Particle Systems.
Manipulator Dynamics 2 Instructor: Jacob Rosen
Motion in Real and Virtual Worlds
Particle Systems Ed Angel
Computer Animation Algorithms and Techniques
Particle Systems - A Technique for Modeling a Class of Fuzzy Objects
Particle Systems.
GPAT – Chapter 7 Physics.
Presentation transcript:

Particle Systems 1 Adapted from: E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012

2 Particle Systems loosely defined ­modeling, or rendering, or animation key criteria ­collection of particles ­random element controls attributes position, velocity (speed and direction), color, lifetime, age, shape, size, transparency predefined stochastic limits: bounds, variance, type of distribution

3 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Introduction Most important of procedural methods Used to model ­Natural phenomena Clouds Terrain Plants ­Crowd Scenes ­Real physical processes

4 Particle Systems Demos general particle systems ­ boids: bird-like objects ­

5 Particle Life Cycle generation ­randomly within “fuzzy” location ­initial attribute values: random or fixed dynamics ­attributes of each particle may vary over time color darker as particle cools off after explosion ­can also depend on other attributes position: previous particle position + velocity + time death ­ age and lifetime for each particle (in frames) ­or if out of bounds, too dark to see, etc

6 Particle System Rendering expensive to render thousands of particles simplify: avoid hidden surface calculations ­each particle has small graphical primitive (blob) ­pixel color: sum of all particles mapping to it some effects easy ­ temporal anti-aliasing (motion blur) normally expensive: supersampling over time position, velocity known for each particle just render as streak

7 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

8 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

9 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

10 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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) }

11 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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 )

12 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Meshes Connect each particle to its closest neighbors ­O(n) force calculation Use spring-mass system

13 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

14 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

15 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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 ·

16 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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)?

17 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

18 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

19 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

20 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

21 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

22 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

23 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 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

24 E. Angel and D. Shreiner: Interactive Computer Graphics 6E © Addison-Wesley 2012 Contact Forces