Presentation is loading. Please wait.

Presentation is loading. Please wait.

CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation.

Similar presentations


Presentation on theme: "CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation."— Presentation transcript:

1 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation

2 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Rigid Bodies Rigid bodies have both a position and orientation Rigid bodies assume no object deformation Rigid body motion is represented by 2 parameters - center of mass - orientation (rotation matrix)

3 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Rigid Bodies Objects are defined in body space and transformed by the position and orientation into world space

4 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Linear Velocity The change of the center of mass over time For a pure translation ( constant), all points move with velocity

5 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Angular Velocity The change in orientation over time Encodes both the axis and speed of the rotation  direction encodes the axis  magnitude encodes the speed (rad/s) But, how are and related?

6 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Angular Velocity For a given vector The columns of represent the transformed axes

7 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer We can represent the cross product with a matrix Angular Velocity Therefore

8 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Since a point can be represented at any time by Velocity of a Point Total velocity can then be expressed as Which can be rewritten as

9 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer We can apply forces to the object at any point Force Total force on an object is simply No information about where the forces are applied

10 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Torque describes the “rotational force” Torque Total torque on an object is simply Tells us about the force distribution over the object

11 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Linear momentum of a particle is Linear Momentum Linear momentum of a rigid body is then density integration over the body

12 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Linear momentum can be simplified as follows Linear Momentum Assuming constant mass gives

13 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Angular momentum of a rigid body Angular Momentum Taking the time derivative inertia tensor Angular momentum is conserved for no torque

14 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Describes how mass is distributed in the body Inertia Tensor Analogous to mass in linear velocity Measures the preferred axis of rotation Expensive to compute this at every time step

15 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Rewrite the tensor as Inertia Tensor Integrals can now be precomputed

16 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Combining the equations Rigid Body Equations of Motion Discretize these continuous equations and integrate

17 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Use quaternions to represent orientation Using Quaternions The update rule is then

18 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Using quaternions gives Rigid Body Equations of Motion Discretize these continuous equations and integrate

19 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer So far, no interaction between rigid bodies Collisions and Contact Collision detection – determining if, when and where a collision occurs Collision response – calculating the state (velocity, …) after the collision

20 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer What should we do when there is a collision? Collisions and Contact

21 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Restart the simulation at the time of the collision Rolling Back the Simulation Collision time can be found by bisection, etc.

22 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Exploit coherency through witnessing Collision Detection Speed up with bounding boxes, grids, hierarchies, etc. separating plane Two convex objects are non-penetrating iff there exists a separating plane between them First find a separating plane and see if it is still valid after the next simulation step

23 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Conditions for collision Collision Detection separatingcontactcolliding

24 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Soft Body Collision Collision Force is applied to prevent interpenetration

25 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Soft Body Collision Collision Apply forces and change the velocity

26 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Harder Collision Collision Higher force over a shorter time

27 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Rigid Body Collision Collision Impulsive force produces a discontinuous velocity

28 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer We need to change velocity instantaneously Impulse Infinite force in an infinitesimal time An impulse changes the velocity as or

29 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer An impulse also creates an impulsive torque Impulse The impulsive torque changes the angular velocity or

30 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer For a frictionless collision Impulse But how do we calculate ?

31 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer For a frictionless collision Impulse Given this equation and knowing how affects the linear and angular velocities of the two bodies, we can solve for

32 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Bodies are neither colliding nor separating Resting Contact We want a force strong enough to resist penetration but only enough to maintain contact

33 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer We want to prevent interpenetration Resting Contact Since we should keep it from decreasing Describes the objects’ acceleration towards one another

34 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Contact forces only act in the normal direction Resting Contact Contact forces should  avoid interpenetration  be repulsive workless force  become zero if the bodies begin to separate

35 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer The relative accelerations can be written in terms of all of the contact forces Resting Contact So we can simply solve a Quadratic Program to find the solution to all the constraints

36 CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Algorithm with collisions and contact Simulation Algorithm compute new statedetect collisions and backtrack compute and apply impulses compute and apply constraint forces current state next state collision state post-collision state


Download ppt "CS274 Spring 01 Lecture 7 Copyright © Mark Meyer Lecture VII Rigid Body Dynamics CS274: Computer Animation and Simulation."

Similar presentations


Ads by Google