Download presentation
Presentation is loading. Please wait.
Published byKelly Lucas Modified over 9 years ago
1
Particle Systems
2
Applications Particle systems are broadly defined for: Explosion Cloth Fluid And more… It is integrated into many animation software, such as Maya. It is based on particles. A particle: Has no volume Has no orientation, no rotation Only has a position (and velocity, and acceleration)
3
Position: Velocity: Acceleration: Math
4
Basic Animation Scheme Given the status at the current frame, simulate the status for the next frame. t0t0 t1t1 t2t2 t3t3 Time step: Δt = t i+1 -t i
5
A simple Example When a particle is only affected by gravity, it follows a parabolic trajectory (such as a cannon ball). Constant gravity t0t0 t 0 +Δt t 0 +2Δt t 0 +3Δt
6
A simple Example What about the particle position? velocity, not constant t0t0 t 0 +Δt t 0 +2Δt t 0 +3Δt
7
Integral Definition t v v(t) t0t0 t1t1 What is x 1 -x 0 ? Δt v0v0 v1v1 Solution 1: Explicit Euler Solution 2: Implicit Euler Solution 3: Trapezoid Rule
8
A simple Example No need to keep x and v for each frame. Just have a single vector for each of them, and update them over time. t0t0 t 0 +Δt t 0 +2Δt t 0 +3Δt
9
Mass-Spring System The mass-spring system is based on the Hooke’s law:
10
Mass-Spring System Damping force:
11
Mass-Spring System Total force: It is a function of x and v:
12
Velocity Update The velocity update in a mass-spring system: t0t0 t 0 +Δt t 0 +2Δt t 0 +3Δt Explicit Euler Method
13
Position Update The position update in a mass-spring system: t0t0 t 0 +Δt t 0 +2Δt t 0 +3Δt Explicit Euler Method
14
Summary: Explicit Method Both velocity and Position update: t0t0 t 0 +Δt t 0 +2Δt t 0 +3Δt
15
Summary: Implicit Method Both velocity and Position update: t0t0 t 0 +Δt t 0 +2Δt t 0 +3Δt
16
Implicit Method Given x 0 and v 0, we need to find x 1 and v 1 : Difficult to solve directly, solve v 1 using Taylor expansion as an approximation instead.
17
Explicit vs. Implicit Explicit Easy to understand Easy to implement Has the stability issue (the time step Δt must be small, otherwise it will produce wrong solutions or even crash) Each time step runs faster, but overall, it is slower Implicit Take time to implement Has less (or even no) stability issue Each time step needs more time, but overall, it runs faster
18
Errors and Stability Numerical simulation always has errors (caused by the approximation of the integral). Smaller time steps have less error. Larger time steps have more error. Intuitively, stability doesn’t mean less error. Instead, it means whether the error can diminish over time. Instability means the error becomes bigger and bigger, so eventually the result becomes useless…
19
Summary: Explicit Method void Update(dt) { Calculate F; x+=v*dt; v+=F*dt/m; } 1 st -order Forward Euler void Update(dt) { x+=v*dt; Calculate F; v+=F*dt/m; } Leapfrog Method (more accurate)
20
Force in a Mass-Spring System P P0P0 P1P1 P2P2 P3P3 P4P4 The force on P: Gravity Damping Spring force
21
Mass-Spring Models A string: Stretching Bending No twisting
22
Mass-Spring Models Cloth (Structured): Bending
23
Mass-Spring Models Cloth (Unstructured):
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.