1 / 41

Animation CS 551 / 651

Animation CS 551 / 651. Rigid-body Simulation Mirtich Paper. Mirtich, 2000. Timewarp Rigid Body Simulation. Presented at SIGGRAPH 2000 Brian Mirtich MERL, A Mitsubishi Electric Research Lab (Cambridge, MA). What stages are in a simulation?. Integration Collision checking (impacts)

dulcea
Télécharger la présentation

Animation CS 551 / 651

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. AnimationCS 551 / 651 Rigid-body SimulationMirtich Paper Mirtich, 2000

  2. Timewarp Rigid Body Simulation • Presented at SIGGRAPH 2000 • Brian Mirtich • MERL, A Mitsubishi Electric Research Lab (Cambridge, MA)

  3. What stages are in a simulation? • Integration • Collision checking (impacts) • Force computation • Constraints (non penetration) • Control • What is this?

  4. How much time do they take? • What’s so slow? • Why do multibodies exacerbate this?

  5. Big Idea • Simulations are slow • What part is so slow??? • Simulations are discontinuous • What’s the source of discontinuities? • Collisions, contacts, rolling sliding, etc. • But not discontinuities are unpredictable and only affect parts of simulation

  6. A simple game of Pong • What goes on in this sim? • Integration • Collision checking • Collision resolution • Would this scale well if balls didn’t collide with each other?

  7. General rigid body simulator • Nontrivial geometries • All pairs can potentially collide • Second-order physics equations of motion • Could be deployed on multiprocessor (simulation farm)

  8. Discontinuities • When do they occur? • When the state or equations of motion change • Collisions • New contacts • Changing from rolling to sliding dynamics

  9. Discontinuities • From §2.1 Root finding method localizes the exact moment of a discontinuity • What is a root? • How do we find the roots?

  10. Newton-Raphson • Find the zero of an equation (where it crosses the x-axis) • If pn is close to pn-1then return pn • else set pn-1 = pn and repeat

  11. Newton-Raphson • Why set • y-intercept equation of line: y = mx + b • let y-intercept, b = f (pn-1) • let slope, m = f’(pn-1) • we want to find x-value where y-value = 0 • let y = 0 • 0 = f’(pn-1) * x + f(pn-1) • solve for x: -f(pn-1) / f’(pn-1)

  12. Newton-Raphson • Be aware that Newton-Raphson could set pn to a value not defined by curve • f’(pn-1) could be 0 (cannot divide by 0)

  13. Discontinuities • What trouble do they cause? • Integrator must be stopped and restarted with new state, forces, or equations • Main control loop constantly checking for discontinuities so appropriate handling takes place • Two common methods • Retroactive detection and conservative advancement

  14. A general simulation problem • §3 references DES, Discrete Event Simulations • Much more than graphics simulations encounter these challenges • Many simulations are represented as DES and thus this technology is relevant

  15. Retroactive Detection • Catch discontinuities after the happen • Detect when two objects go through one another • Use root finding to detect exact time of impact • Roll back the clock to time of impact • All objects or just some? • Continue simulation only up to impact

  16. Retroactive Detection • What’s bad about this algorithm? • You’re repeating work • Simulate, back up, simulate again • Additional collisions may be encountered during subsequent smaller simulation timesteps (and others won’t take place after all) • Synchronization requires repeated simulation of all objects if they are involved in collision or not • Doesn’t scale well in number of discontinuities

  17. Conservative Advancement • Don’t simulate past discontinuities • Heuristics predict future discontinuities and impending events are stored in a priority queue • Upon approaching time of event in priority queue, take small steps

  18. Conservative Advancement • What’s bad about this method? • Conservative, but slow as number of discontinuities increases • All simulated objects move forward at small timestep • Difficult to compute tight bounds on discontinuities

  19. Timewarp Algorithm • Derived from a 1985 paper by David Jefferson • Be optimistic • Each object simulates as quickly as possible • Be responsive • If an object is informed of an event in the past, it must reset its state to that previous time

  20. What is STATE? • What is the state in the rigid body sims?

  21. Timewarp • Multiple processes • Each models part of the system • Each has its own “time” called Local Virtual Time (LVT) • Process clocks are not synchronized

  22. Timewarp • Message Passing • When a process experiences an event • message is sent to all processes with timestamp = LVT of sending process • When a process receives a message • If (message time > recipient’s LVT) • Message is placed on time-based queue • Process will advance clock to next event on queue • What if (message time < recipient’s LVT)?

  23. Rollback • Occurs when a recipient has simulated “past” the time at which another process has generated an event • Go back in time (how?) • Put all processed events back on queue • “unsend” events sent to other processes • For each message sent, an antimessage is stored on a queue that can be easily flushed

  24. Rollback • Overhead • Keeping track of previous states • Keeping track of processed events • Keeping track of submitted events • Global Virtual Time (GVT) • The minimum of all LVTs and safe times (why?) • All states before GVT can be purged • Monotonically increasing

  25. Timewarp for rigid body sim • Every simulated body is a process • The state = position & velocity • Global event queue stores all bodies’ events • Event = timestamp and list of affected bodies • Main loop • Pull front item from event queue • Simulate affected bodies to that time • This can be put on a uniprocessor

  26. Types of events • Collision Check • Between pairs of bodies • Group Check • Collision check for contacting bodies • Splitting groups of bodies when no longer contacting • Redraw • At every new rendered frame, copy positions to buffer • Callback • User-defined functions to be executed

  27. Collisions • Safe-time • Each body keeps track of the last time it was known not to be in collision with other bodies • This helps limit how far a body must roll back upon detection of a collision • Safe-time is included in collision/group check events • Upon collision checking, safe-time is updated

  28. Collisions (A collides with B) • Vertical connections join post-collision states • Gray states are new states after A-B collision check event

  29. Collision (between A and B)

  30. Multibodies • Jointed (articulated) bodies like a human • All bodies must be treated in unison • Easily integrated into their system

  31. Contact Groups • Bodies in persistent contact • Simulated as a unit • Membership of group is dynamic • Complicated state keeping so, upon rollback, a body can be detached from its group and simulated

  32. Collision checks • Active Pairs • The set of all bodies that must be checked for potential collisions • We want to keep this set small

  33. Active Pairs • Looking for collisions • Each body has an axis-aligned bounding box • For each timestep between GVT and LVT • Record location of bounding box • Compute bounding box (swept volume) of all bounding boxes over time • Using six heaps for max/min {x, y, z} • GVT increment causes volume to shrink

  34. Looking for collisions • If swept volumes do not intersect • Collision free between [GVT, tmin (A, B)] • Depending on LVT of A and B • A and B not an active pair

  35. Looking for collisions • If newest timestep for B causes overlapping swept volume with A • Collision check at time tmin (A, B) • B, before integration (last known free time) • Rollback will resolve collisions

  36. Results • Applications • Atoms: 200 spheres and 100 water molecules in divided box • Cars: 4 multibody vehicles and 400 pendula • Robots: 20 eight-link manipulators throwing blocks • Avalanche: 300 rocks tumbling down mountainside

  37. Results • Note average integration step vs. time between discontinuities • Look at cars vs. robots

  38. Results • Atoms for 2 seconds • Average integration step • Conservative advancement slows down

  39. Results • Atoms for 2 seconds • Total “work done” per simulated object • Retroactive detection repeats a lot of work

  40. Results • Total time • 100 atoms • RD-1/30 = 0.142, TW = 0.147, CA = 1.15 • 200 atoms • RD -1/30 = 2.61, TW = .388, CA = 4.74

  41. Discussion • §4.2 – If rollback time is between safe time and current time, nothing is done… • Jefferson proved this was what? • Figure 2 • No global state

More Related