Docsity

Particle Systems - Computer Animation - Lecture Slides, Slides of Computer Graphics and Animation

Partial preview of the text

Download Particle Systems - Computer Animation - Lecture Slides and more Slides Computer Graphics and Animation in PDF only on Docsity!

Particle Systems

Particle Systems

 Particle systems have been used extensively in

computer animation and special effects since

their introduction to the industry in the early

1980’s

 The rules governing the behavior of an individual

particle can be relatively simple, and the

complexity comes from having lots of particles

 Usually, particles will follow some combination of

physical and non-physical rules, depending on

the exact situation

Kinematics of Particles ( ) 2 2 dt d dt d dt d t v r a r v r r = = = =

 We will define an individual particle’s 3D position

over time as r (t)

 By definition, the velocity is the first derivative of

position, and acceleration is the second

Kinematics of Particles  To render a particle, we need to know it’s position r.

Uniform Acceleration  This shows us that the particle’s motion will follow a parabola  Keep in mind, that this is a 3D vector equation, and that there is potentially a parabolic equation in each dimension. Together, they form a 2D parabola oriented in 3D space  We also see that we need two additional vectors r 0 and v 0 in order to fully specify the equation. These represent the initial position and velocity at time t= 2 0 0 0 2 1 r = r + v t + a t

Mass and Momentum p = m v

 We can associate a mass m with each particle.

We will assume that the mass is constant

 We will also define a vector quantity called

momentum ( p ), which is the product of mass

and velocity

0 m = m

Force ( ) f a v v v v f m dt d m dt d m dt dm dt d m = = = + =

 Force is defined as the rate of change of

momentum

 We can expand this out:

dt d p f =

Newton’s Second Law  Newton’s Second Law says:  This relates the kinematic quantity of acceleration to the physical quantity of force a p f m dt d = =

Conservation of Momentum

 Any gain of momentum by a particle must be

met by an equal and opposite loss of momentum

by another particle. Therefore, the total

momentum in a closed system will remain

constant

 We will not always explicitly obey this law, but

we will implicitly obey it

 In other words, we may occasionally apply

forces without strictly applying an equal and

opposite force to anything, but we will justify it

when we do

Energy

 The quantity of ‘energy’ is very important

throughout physics, and the motion of particle

can also be formulated in terms of energy

 Energy is another important quantity that is

conserved in real physical interactions

 However, we will mostly use the simple

Newtonian formulations using momentum

 Occasionally, we will discuss the concept of

energy, but probably won’t get into too much

detail just yet

Particle Simulation

 Basic kinematics allows us to relate a particle’s

acceleration to it’s resulting motion

 Newton’s laws allow us to relate acceleration to

force, which is important because force is

conserved in a system and makes a useful

quantity for describing interactions

 This gives us a general scheme for simulating

particles (and more complex things):

Particle Simulation

  1. Compute all forces acting within the system in the current configuration (making sure to obey Newton’s third law)
  2. Compute the resulting acceleration for each particle ( a = f /m) and integrate over some small time step to get new positions
  • Repeat  This describes the standard ‘Newtonian’ (or actually, ‘Eulerian’) approach to simulation. It can be extended to rigid bodies, deformable bodies, fluids, vehicles, and more

Particle Example class ParticleSystem { int NumParticles; Particle *P; public: void Update(deltaTime); void Draw(); };

Particle Example ParticleSystem::Update(float deltaTime) { // Compute forces Vector3 gravity(0,-9.8,0); for(i=0;i<NumParticles;i++) { Vector3 force=gravity*Particle[i].Mass; // f =m g Particle[i].ApplyForce(force); } // Integrate for(i=0;i<NumParticles;i++) Particle[i].Update(deltaTime); }