Presentation is loading. Please wait.

Presentation is loading. Please wait.

3D Physics Simulation Steven Durant. Contents Equations –Gravity –Euler’s Method –Simple Collisions –Correct Collisions Efficiency Applications Screenshots.

Similar presentations


Presentation on theme: "3D Physics Simulation Steven Durant. Contents Equations –Gravity –Euler’s Method –Simple Collisions –Correct Collisions Efficiency Applications Screenshots."— Presentation transcript:

1 3D Physics Simulation Steven Durant

2 Contents Equations –Gravity –Euler’s Method –Simple Collisions –Correct Collisions Efficiency Applications Screenshots

3 Gravity F = G * M 1 * M 2 / R 2 Unavoidable efficiency of O(n 2 )

4 Euler’s Method a = F / M ∆v = a * ∆t ∆p = v * ∆t

5 Simple (Elastic) Collisions Check for collision via particle radius Conservation of momentum –v 1 ’ = v 2 * M 2 / M 1 –v 2 ’ = v 1 * M 1 / M 2 This method is flawed

6 Correct Collisions Find next collision based on time –O(n 2 ) Find distance between particles Find distance moved into each other ∆D ∆d

7 Correct Collisions Find fraction of timestep until collision ∆t = 1 – ( ∆d / ∆D ) Move both particles for the fraction –Use ∆t in Euler’s Equations Calculate new velocities –Use conservation of momentum Move both particles for the other fraction –Use (1-∆t) in Euler’s Equations

8 Efficiency Pruning pairs of particles –Pairs moving away from each other. –Pairs too far apart. Pretend their velocities are towards each other If they still won’t collide before the nearest collision then their real velocities don’t need to be used or checked.

9 Application Find out how long it would take for two apples on a frictionless table to collide by using realistic masses for the apples. Put thousands of tiny little masses along a random distribution and see what the end product is. –Stuff orbiting each other? –One big blob?

10 Screenshots


Download ppt "3D Physics Simulation Steven Durant. Contents Equations –Gravity –Euler’s Method –Simple Collisions –Correct Collisions Efficiency Applications Screenshots."

Similar presentations


Ads by Google