Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Particle Systems
CMPT 466
Computer Animation
Torsten Mller
Forward Kinematics
Inverse Kinematics
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Reading
Velocity
Position
Color
Lifetime
Fire
Smoke
Fireworks
Planets
Mller/Parent/Machiraju
Particle Systems
Example
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particle Systems
Agents @ work
Mller/Parent/Machiraju
Particle Systems
Particle Systems
Render particles
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particle Motion
Global exterior forces such as gravity, wind, predetermined path or target position, etc.
Contact interactions with environment
Collisions
Friction
other
Mller/Parent/Machiraju
from K. Sims movie Particle Dreams (1988)
Particle are created, they move, and then go extinct (so the effect is localized)
XXX (2002)
Avalanche effect by Digital Domain
~150,000 particles
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particle Systems
Differ from other representations:
clouds of particles define objects volume
(NO explicit boundary)
non deterministic
The Two Towers (2002)
Soldiers in battle scenes are articulated particles that
each run small AI program to guide motion, actions
courtesy of massivesoftware.com
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particle Systems
Particle Systems
Reaction to environment
Aging: Time-varying attributes
birth
Source
death
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particles - Generation
Particles - Generation
Mller/Parent/Machiraju
X and Y coordinates
X velocity
Y velocity
Color, Size (or image)
Lifetime
Shape
Particle - Attributes
shape of a system may constrain direction
of initial velocity
Particle - Attributes
These shapes positioned, oriented in a 3D
world
initial position of particle is with respect to
shape of particle system
Mller/Parent/Machiraju
Particle - Attributes
compute speed by:
speedinit = speedmean + Rand()*Varspeed
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particle Systems
Levels of operations between explicit
kinematic control and physically based
simulations
position operations (kinematics)
velocity operations
acceleration operations (dynamics)
Particle - Dynamics
To move particle, add velocity vector
can add acceleration factor to simulate
gravity
particles can change color, transparency and
size over time
control these changes by global or local
rate-of-change parameters
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Forces
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Forces
fgravity(t) = m g
!x = xa- xb,
d = displacement, and
!v = va - vb
f a = " k s ( #x " r) + k d #v $ d d
Gravitational attraction
Based on proximity
Electrical charge
Specific to connected particles
Springs
Mller/Parent/Machiraju
damping constant
spring constant
(stiffness) Mller/Parent/Machiraju(like spring drag)
Spring systems
Cloth Simulation I
Mller/Parent/Machiraju
courtesy of F. Pfenning
Spring networks
for cloth
Mller/Parent/Machiraju
courtesy of R. Bridson (http://www.cs.ubc.ca/~rbridson)
Cloth Simulation II
Mller/Parent/Machiraju
Mller/Parent/Machiraju
courtesy of R. Bridson (http://www.cs.ubc.ca/~rbridson)
Particle Physics
Accumulate forces
Calculate acceleration
Assume constant acceleration over
delta time
Average velocity
= (vold+ vold+a*dt)/2 = vold + a*dt/2
Positionnew = positionold + v*dt+a*dt2/2
Mller/Parent/Machiraju
from http://www.cs.virginia.edu/~gfx/Courses/2002/Animation.spring.02/; creators unknown
Mller/Parent/Machiraju
!
Mller/Parent/Machiraju
Particle - Extinction
Lifetime assigned as initial attribute
often described in frames
compute by
Lifetime = Lifemean + Rand()*Varlife
Mller/Parent/Machiraju
Particle - Rendering
In general a difficult task (e.g. to ray trace
several million particles!)
problems:
particles can be transparent
can obscure other particles and/or other objects
can cast shadows on other particles and/or other
objects
can interact with other objects
Mller/Parent/Machiraju
Particle - Rendering
simplifying approaches are used
assume each particle is a separate point light
particles have cumulative effect on pixel
if particles are moving, can represent as short
line (a kind of motion blur - this also helps
reduce strobing - i.e. temporal aliasing)
render separately from other types of objects
and composite various scene parts
Some Code
class Particle {
double x, y, xVel, yVel;
int lifeCounter;
Particle(int startx, int starty, int velX, int velY){
x = startx; y = starty;
xVel = velX; yVel = velY;
lifeCounter = 0;
}
}
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Some Code
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particle - Genesis
Serious slowdown
Serious garbage potential
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particle - Genesis
position computed by adding velocity
vector to previous position
Particle - Genesis
velocity vector can be updated with
acceleration vector (e.g. to account for
gravity)
choose randomly:
placing on disk
generation rate
initial velocity
lifetime
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Particle - Genesis
Other work
Brogan,
hodgins
from C. Reynolds
Mller/Parent/Machiraju
Flocking
Geometric objects
Many objects
Simple motion - e.g., local rules, more
physics, collision avoidance
Consider other members.
Local Control
Perception
Physics
Reasoning and Reaction
Mller/Parent/Machiraju
Mller/Parent/Machiraju
More control:
Collision avoidance
Velocity matching
Mller/Parent/Machiraju
Centering
courtesy of C. Reynolds
Local Perception
Global Perception
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Physics
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Collision Avoidance
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Collision Avoidance
Collision Avoidance
Mller/Parent/Machiraju
Mller/Parent/Machiraju
Steer To Avoid
- Simulating Sight
Steer to closest point on
boundary sphere
Steer to closest point on
boundary of silhouette
Steer to first
non-intersecting feeler
Steer to closest background
point of projection.
Mller/Parent/Machiraju
Flocking - Recap
Fewer members than in particle systems
Knowledge of, and reaction to, other
members
More physics - modeling flight, banking,
etc.
More intelligence - reasoning about path
Emergent Behavior - global behavior from
local rules
Mller/Parent/Machiraju