1 / 10

3D Physics Simulation

Steven Durant. 3D Physics Simulation. Contents. Equations Gravity Euler’s Method Simple Collisions Correct Collisions Efficiency Applications Screenshots. Gravity. F = G * M 1 * M 2 / R 2 Unavoidable efficiency of O(n 2 ). Euler’s Method. a = F / M ∆v = a * ∆t ∆p = v * ∆t.

zorina
Download Presentation

3D Physics Simulation

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Steven Durant 3D Physics Simulation

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

  3. Gravity • F = G * M1 * M2 / R2 • Unavoidable efficiency of O(n2)

  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 • v1’ = v2 * M2 / M1 • v2’ = v1 * M1 / M2 • This method is flawed

  6. Correct Collisions • Find next collision based on time • O(n2) • 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

More Related