Particle Systems Lots of objects Simple objects e
Particle Systems Lots of objects Simple objects - e. g. , rendered as point light sources Too small to worry about Simple motion - e. g. , local rules, simple physics Ignore collisions between particles too many to worry about Did I mention there are lots of objects? Rick Parent - CIS 682
For each frame 1. Terminate any expired particles 2. Update attributes according to controlling procedures 3. Create new particles and assign attributes 4. Render particles. Rick Parent - CIS 682
For each frame Reaction to environment Aging: Time-varying attributes birth Source death Rick Parent - CIS 682
Particle Generation Controlled random process Distribute over space and over time Synch generation with particle termination to keep bounded number of particles alive at any time. Rick Parent - CIS 682
Particle Attributes position velocity Shape (if any) Display attributes (e. g. color, transparency) Age & Life expectancy (pseudo random). Rick Parent - CIS 682
Particle System Representation position Array of velocity mass age Rick Parent - CIS 682
Updating Particle System 1. If too old, remove & regenerate, age = 1 Else update age. 2. Calculate applied forces 3. Compute acceleration, velocity 4. Update position. Rick Parent - CIS 682
Particle Physics Unary based on position, velocity: e. g. , gravity, viscosity Environmental: repulsion forces, reaction to collisions Rick Parent - CIS 682
Simple Physics F = ma a = m/F Gravity: F = m 1*m 2*G/distance 2 : a = 32 ft/s 2 = 9. 8 m/s 2 Force fields, e. g. , wind. Springs: F = (d-drest)*kspring Viscosity / Damping / Friction: F = -v*kviscosity Rick Parent - CIS 682
Implement Physics Accumulate forces Calculate acceleration Assume constant acceleration over delta time Average velocity = (vold+a*dt)/2 = v old + a*dt/2 positionnew = positionold + v*dt+a*dt 2/2. Rick Parent - CIS 682
Particle Systems - Recap Lots and lots of members Simple physics No knowledge of other members Minimal geometry of members Emergent Behavior - global behavior from local rules. Rick Parent - CIS 682
- Slides: 11