Particle Systems. University of Texas at Austin CS384G - Computer Graphics Fall 2010 Don Fussell

Similar documents
Particle Systems. University of Texas at Austin CS384G - Computer Graphics

Rigid Body Dynamics 2. CSE169: Computer Animation Instructor: Steve Rotenberg UCSD, Winter 2018

Δt The textbook chooses to say that the average velocity is

AP-C WEP. h. Students should be able to recognize and solve problems that call for application both of conservation of energy and Newton s Laws.

FZX: Personal Lecture Notes from Daniel W. Koon St. Lawrence University Physics Department CHAPTER 7

30 The Electric Field Due to a Continuous Distribution of Charge on a Line

An Exact Solution of Navier Stokes Equation

To Feel a Force Chapter 7 Static equilibrium - torque and friction

MODULE 5a and 5b (Stewart, Sections 12.2, 12.3) INTRO: In MATH 1114 vectors were written either as rows (a1, a2,..., an) or as columns a 1 a. ...

EN40: Dynamics and Vibrations. Midterm Examination Thursday March

Fluid flow in curved geometries: Mathematical Modeling and Applications

Math Notes on Kepler s first law 1. r(t) kp(t)

Physics 2B Chapter 22 Notes - Magnetic Field Spring 2018

Galilean Transformation vs E&M y. Historical Perspective. Chapter 2 Lecture 2 PHYS Special Relativity. Sep. 1, y K K O.

Physics 181. Assignment 4

ME 210 Applied Mathematics for Mechanical Engineers

Centripetal Force. Lecture 11. Chapter 8. Course website:

Chapter 2: Basic Physics and Math Supplements

ASTR415: Problem Set #6

PHYS 110B - HW #7 Spring 2004, Solutions by David Pace Any referenced equations are from Griffiths Problem statements are paraphrased

COLLAPSING WALLS THEOREM

Classical Mechanics Homework set 7, due Nov 8th: Solutions

ME 3600 Control Systems Frequency Domain Analysis

you of a spring. The potential energy for a spring is given by the parabola U( x)

Rotational Motion. Lecture 6. Chapter 4. Physics I. Course website:

PS113 Chapter 5 Dynamics of Uniform Circular Motion

A Relativistic Electron in a Coulomb Potential

arxiv: v1 [physics.pop-ph] 3 Jun 2013

Physics 235 Chapter 5. Chapter 5 Gravitation

MA557/MA578/CS557. Lecture 14. Prof. Tim Warburton. Spring

PHYS 172: Modern Mechanics. Summer Lecture 4 The Momentum Principle & Predicting Motion Read

MATH 415, WEEK 3: Parameter-Dependence and Bifurcations

Lab 10: Newton s Second Law in Rotation

Solving Problems of Advance of Mercury s Perihelion and Deflection of. Photon Around the Sun with New Newton s Formula of Gravity

MASSACHUSETTS INSTITUTE OF TECHNOLOGY Physics Department Physics 8.07: Electromagnetism II September 15, 2012 Prof. Alan Guth PROBLEM SET 2

KEPLER S LAWS OF PLANETARY MOTION

PHYS 172: Modern Mechanics. Fall Lecture 6 Fundamental Forces, Reciprocity Read

Numerical Integration

AH Mechanics Checklist (Unit 2) AH Mechanics Checklist (Unit 2) Circular Motion

- 5 - TEST 1R. This is the repeat version of TEST 1, which was held during Session.

Reading Assignment. Problem Description for Homework #9. Read Chapters 29 and 30.

15 Solving the Laplace equation by Fourier method

2 Governing Equations

HW Solutions # MIT - Prof. Please study example 12.5 "from the earth to the moon". 2GmA v esc

Math 2263 Solutions for Spring 2003 Final Exam

Physics 161 Fall 2011 Extra Credit 2 Investigating Black Holes - Solutions The Following is Worth 50 Points!!!

Chapter 13 Gravitation

Circular Orbits. and g =

Lab #4: Newton s Second Law

OSCILLATIONS AND GRAVITATION

J. Electrical Systems 1-3 (2005): Regular paper

Implicit Constraint Enforcement for Rigid Body Dynamic Simulation

Physics 111 Lecture 5 (Walker: 3.3-6) Vectors & Vector Math Motion Vectors Sept. 11, 2009

. Using our polar coordinate conversions, we could write a

EN40: Dynamics and Vibrations. Midterm Examination Tuesday March

CALCULUS II Vectors. Paul Dawkins

When a mass moves because of a force, we can define several types of problem.

Topic 4a Introduction to Root Finding & Bracketing Methods

DonnishJournals

Physics Fall Mechanics, Thermodynamics, Waves, Fluids. Lecture 18: System of Particles II. Slide 18-1

Lecture 8 - Gauss s Law

Do not turn over until you are told to do so by the Invigilator.

Describing Circular motion

Homework # 3 Solution Key

Chapter 5 Force and Motion

Phys 201A. Homework 6 Solutions. F A and F r. B. According to Newton s second law, ( ) ( )2. j = ( 6.0 m / s 2 )ˆ i ( 10.4m / s 2 )ˆ j.

Chapter 5 Force and Motion

High precision computer simulation of cyclotrons KARAMYSHEVA T., AMIRKHANOV I. MALININ V., POPOV D.

PHYS Summer Professor Caillault Homework Solutions. Chapter 5

Transformations in Homogeneous Coordinates

Markscheme May 2017 Calculus Higher level Paper 3

r cos, and y r sin with the origin of coordinate system located at

Question 1: The dipole

B da = 0. Q E da = ε. E da = E dv

Computational Methods of Solid Mechanics. Project report

Spring 2001 Physics 2048 Test 3 solutions

School of Electrical and Computer Engineering, Cornell University. ECE 303: Electromagnetic Fields and Waves. Fall 2007

Physics NYB problem set 5 solution

working pages for Paul Richards class notes; do not copy or circulate without permission from PGR 2004/11/3 10:50

Flux. Area Vector. Flux of Electric Field. Gauss s Law

Motion in One Dimension

MAGNETIC FIELD AROUND TWO SEPARATED MAGNETIZING COILS

Appendix A. Appendices. A.1 ɛ ijk and cross products. Vector Operations: δ ij and ɛ ijk

Part V: Closed-form solutions to Loop Closure Equations

Related Rates - the Basics

Supplementary Figure 1. Circular parallel lamellae grain size as a function of annealing time at 250 C. Error bars represent the 2σ uncertainty in

2. Electrostatics. Dr. Rakhesh Singh Kshetrimayum 8/11/ Electromagnetic Field Theory by R. S. Kshetrimayum

The Poisson bracket and magnetic monopoles

Physics 211: Newton s Second Law

VECTOR MECHANICS FOR ENGINEERS: STATICS

d 2 x 0a d d =0. Relative to an arbitrary (accelerating frame) specified by x a = x a (x 0b ), the latter becomes: d 2 x a d 2 + a dx b dx c

7.2. Coulomb s Law. The Electric Force

Tutorial Exercises: Central Forces

Absorption Rate into a Small Sphere for a Diffusing Particle Confined in a Large Sphere

( ) [ ] [ ] [ ] δf φ = F φ+δφ F. xdx.

Physics 506 Winter 2006 Homework Assignment #9 Solutions

Simulation of a 2-link Brachiating Robot with Open-Loop Controllers

AST 121S: The origin and evolution of the Universe. Introduction to Mathematical Handout 1

Physics 11 Chapter 4: Forces and Newton s Laws of Motion. Problem Solving

10.2 Parametric Calculus

Transcription:

Paticle Systems Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell

Reading Requied: Witkin, Paticle System Dynamics, SIGGRAPH 97 couse notes on Physically Based Modeling. Witkin and Baaff, Diffeential Equation Basics, SIGGRAPH 01 couse notes on Physically Based Modeling. Optional Hocknew and Eastwood. Compute simulation using paticles. Adam Hilge, New Yok, 1988. Gavin Mille. The motion dynamics of snakes and woms. Compute Gaphics 22:169-178, 1988. Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 2

What ae paticle systems? A paticle system is a collection of point masses that obeys some physical laws (e.g, gavity, heat convection, sping behavios, ). Paticle systems can be used to simulate all sots of physical phenomena: Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 3

Paticle in a flow field We begin with a single paticle with: Position, " x = x % # y& y Velocity, v = x = d x dt " dx dt% = # dy dt& g(x,t) Suppose the velocity is actually dictated by some diving function g: x = g( x,t) x Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 4

Vecto fields At any moment in time, the function g defines a vecto field ove x: How does ou paticle move though the vecto field? Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 5

Diff eqs and integal cuves The equation x = g( x,t) is actually a fist ode diffeential equation. We can solve fo x though time by stating at an initial point and stepping along the vecto field: Stat Hee This is called an initial value poblem and the solution is called an integal cuve. Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 6

Eule s method One simple appoach is to choose a time step, Δt, and take linea steps along the flow: x (t + "t) = Witing as a time iteation: x (t) + "t # x(t) = x (t) + "t # g( x,t) x i+1 = x i + "t # v i This appoach is called Eule s method and looks like: Popeties: Simplest numeical method Bigge steps, bigge eos. Eo ~ O(Δt 2 ). Need to take petty small steps, so not vey efficient. Bette (moe complicated) methods exist, e.g., Runge-Kutta and implicit integation. Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 7

Paticle in a foce field Now conside a paticle in a foce field f. In this case, the paticle has: Mass, m Acceleation, a " x = d v dt = d 2 x dt 2 The paticle obeys Newton s law: f = m a = mx The foce field f can in geneal depend on the position and velocity of the paticle as well as time. Thus, with some eaangement, we end up with: f ( x,x,t) x = m Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 8

Second ode equations This equation: x = f ( x,x,t) m is a second ode diffeential equation. Ou solution method, though, woked on fist ode diffeential equations. We can ewite this as: x = v " f ( x, v %,t) v = # m & whee we have added a new vaiable v to get a pai of coupled fist ode equations. Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 9

Phase space " x % # v & " x% # v& " x% " v % = # v& # f m& Concatenate x and v to make a 6- vecto: position in phase space. Taking the time deivative: anothe 6-vecto. A vanilla 1 st -ode diffeential equation. Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 10

Diffeential equation solve Stating with: Applying Eule s method: And making substitutions: " x% " v % = # v& # f m& x (t + "t) = x (t) + "t # x(t) x(t + "t) = x(t) + "t # x(t) x (t + "t) = x (t) + "t # v (t) x(t + "t) = x(t) + "t # f ( x,x,t) m Witing this as an iteation, we have: Again, pefoms pooly fo lage Δt. x i+1 = x i + "t # v i v i+1 = v f i i + "t # m Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 11

Paticle stuctue How do we epesent a paticle?! x " # v # # f # m % & position velocity foce accumulato mass Position in phase space Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 12

Single paticle solve inteface! x " # v # # f # m % & getdim getstate setstate deiveval [ 6]! x" # % v&! v " # /m % f & Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 13

Paticle systems In geneal, we have a paticle system consisting of n paticles to be managed ove time: paticles n time " f 1 # x 1 v 1 m 1 % & " # x 2 v 2 f 2 m 2 % " x n % v n K f n & # & m n Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 14

Paticle system solve inteface Fo n paticles, the solve inteface now looks like: paticles n time get/setstate getdim deiveval 6n x 1 v 1 v 1 f 1 m 1 x 2 v 2 v 2 K x n f 2 K v n m 2 v n f n m n Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 15

Paticle system diff. eq. solve We can solve the evolution of a paticle system again using the Eule method: " M # x 1 i+1 v 1 i+1 x n i+1 v n i+1 % " = M & # x 1 i v 1 i x n i v n i % + (t & " # f 1 i f n i v 1 i M v n i m 1 m n % & Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 16

Foces Each paticle can expeience a foce which sends it on its mey way. Whee do these foces come fom? Some examples: Constant (gavity) Position/time dependent (foce fields) Velocity-dependent (dag) Combinations (Damped spings) How do we compute the net foce on a paticle? Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 17

Paticle systems with foces Foce objects ae black boxes that point to the paticles they influence and add in thei contibutions. We can now visualize the paticle system with foce objects: paticles n time foces nf F 1 F 2 F nf " f 1 # x 1 v 1 m 1 % & " # x 2 v 2 f 2 m 2 % " x n % v n K f n & # & m n Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 18

Gavity and viscous dag The foce due to gavity is simply: f gav = mg p->f += p->m * F->G Often, we want to slow things down with viscous dag: f dag = "k v p->f -= F->k * p->v Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 19

Damped sping Recall the equation fo the foce due to a sping: We can augment this with damping: f = "k sping (# x " ) [ ] f = " k sping (# x " ) + k damp v The esulting foce equations fo a sping between two paticles become: * f 1 = ", k sping +, f 2 = " f 1 # x # ( " ) + k damp & % v # x - # x )/ (./ # x # x = est length " x p 1 = 1 % # v 1 & " x = x 1 # " x p 2 = 2 % # & v 2 x 2 Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 20

deiveval Clea foces Loop ove paticles, zeo foce accumulatos Calculate foces Sum all foces into accumulatos Retun deivatives Loop ove paticles, etun v and f/m " v 1 %" v 2 % " v K n # f 1 m 1 &# f 2 m 2 & # f n m n % & Retun deivatives to solve 1 Apply foces to paticles 3 Clea foce accumulatos Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 21 2 " f 1 # F 1 " f 1 # x 1 v 1 x 1 v 1 m 1 m 1 F 2 F 3 F nf % & % & " # " # x 2 v 2 f 2 x 2 v 2 f 2 m 2 m 2 % " x n % v K n f n & # & m n % " x n % v n K f n & # & m n

Bouncing off the walls P N Add-on fo a paticle simulato Fo now, just simple point-plane collisions A plane is fully specified by any point P on the plane and its nomal N. Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 22

Collision Detection How do you decide when you ve cossed a plane? v P N x Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 23

Nomal and tangential velocity To compute the collision esponse, we need to conside the nomal and tangential components of a paticle s velocity. v N v P N v vt v N = ( N v ) N v T = v " v N Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 24

Collision Response v N "k estitution v N v v T v T " v befoe v " = v T # k estitution v N afte Without backtacking, the esponse may not be enough to bing a paticle to the othe side of a wall. In that case, detection should include a velocity check: Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 25

Paticle fame of efeence Let s say we had ou obot am example and we wanted to launch paticles fom its tip. How would we go about stating the paticles fom the ight place? Fist, we have to look at the coodinate systems in the OpenGL pipeline Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 26

The OpenGL geomety pipeline Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 27

Pojection and modelview matices Any piece of geomety will get tansfomed by a sequence of matices befoe dawing: p = M poject M view M model p The fist matix is OpenGL s GL_PROJECTION matix. The second two matices, taken as a poduct, ae maintained on OpenGL s GL_MODELVIEW stack: M modelview = M view M model Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 28

Robot am code, evisited Recall that the code fo the obot am looked something like: glrotatef( theta, 0.0, 1.0, 0.0 ); base(h1); gltanslatef( 0.0, h1, 0.0 ); glrotatef( phi, 0.0, 0.0, 1.0 ); uppe_am(h2); gltanslatef( 0.0, h2, 0.0 ); glrotatef( psi, 0.0, 0.0, 1.0 ); lowe_am(h3); All of the GL calls hee modify the modelview matix. Note that even befoe these calls ae made, the modelview matix has been modified by the viewing tansfomation, M view. Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 29

Computing paticle launch point To find the wold coodinate position of the end of the obot am, you need to follow a seies of steps: 1. Figue out what M view befoe dawing you model. Mat4f matcam = ps>glgetmatix(gl_modelview_matrix); 2. Daw you model and add one moe tansfomation to the tip of the obot am. 3. Compute gltanslatef( 0.0, h3, 0.0 ); "1 M model = M view M modelview Mat4f paticlexfom = ps->getwoldxfom( matcam); 4. Tansfom a point at the oigin by the esulting matix. Vec4f paticleoigin = paticlexfom * Vec4f(0,0,0,1); // 4 th coodinate should be 1.0 -- ignoe Now you e eady to launch a paticle fom that last computed point! Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 30

Next lectue Topic: Paametic Cuves: C2 intepolating cuves. How can we make splines that intepolate the contol points, and have C2 continuity eveywhee? Reading: Batels, Beatty, and Basky. An Intoduction to Splines fo use in Compute Gaphics and Geometic Modeling, 1987. [Couse eade, pp. 239-247] Univesity of Texas at Austin CS384G - Compute Gaphics Fall 2010 Don Fussell 31