Rigid body dynamics
Rigid body simulation Once we consider an object with spatial extent, particle system simulation is no longer sufficient
Rigid body simulation • Unconstrained system � • no contact � • Constrained system � • collision and contact
Problems Performance is important!
Problems Control is difficult!
Particle simulation � x ( t ) � Y ( t ) = Position in phase space v ( t ) � � v ( t ) ˙ Y ( t ) = Velocity in phase space f ( t ) /m
Rigid body concepts Translation Rotation Position � Orientation Linear velocity � Angular velocity Inertia tensor Mass � Angular momentum Linear momentum � Torque Force
• Position and orientation � • Linear and angular velocity � • Mass and Inertia � • Force and torques � • Simulation
Position and orientation Translation of the body x x ( t ) = y z Rotation of the body r xx r yx r zx R ( t ) = r xy r yy r zy r xz r yz r zz and are called spatial variables of a rigid body x ( t ) R ( t )
Quiz • True or False: Given an arbitrary rotation matrix R � • R is always orthonormal � • R is always symmetric � • RR T = I � • R x (30)R y (60) = R y (60)R x (30)
Body space Body space A fixed and unchanged space where the shape of a rigid body y 0 is defined r 0i The geometric center of the x 0 rigid body lies at the origin of the body space z 0
Position and orientation Body space World space y 0 r 0i R ( t ) y 0 r 0i x 0 z 0 y x 0 x ( t ) z 0 x z
Position and orientation World space Use x ( t ) and R ( t ) to transform the body space into world space y 0 r 0i R ( t ) What are the world coordinates of x 0 an arbitrary point r 0i on the body? z 0 y x ( t ) r i ( t ) = x ( t ) + R ( t ) r 0 i x z
Position and orientation • Assume the rigid body has uniform density, what is the physical meaning of x ( t )? � • center of mass over time � • What is the physical meaning of R ( t )? � • it’s a bit tricky
Position and orientation Consider the x-axis in body space, (1, 0, 0), what is the direction of this vector in world space at time t ? 1 r xx = R ( t ) 0 r xy 0 r xz which is the first column of R ( t ) R ( t ) represents the directions of x, y, and z axes of the body space in world space at time t
Position and orientation • So x ( t ) and R ( t ) define the position and the orientation of the body at time t � • Next we need to define how the position and orientation change over time
• Position and orientation � • Linear and angular velocity � • Mass and Inertia � • Force and torques � • Simulation
Linear velocity Since is the position of the center of mass in x ( t ) world space, is the velocity of the center of mass x ( t ) ˙ in world space v ( t ) = ˙ x ( t )
Angular velocity • If we freeze the position of the COM in space � • then any movement is due to the body spinning about some axis that passes through the COM � • Otherwise, the COM would itself be moving
Angular velocity We describe that spin as a vector ω ( t ) Direction of ? ω ( t ) Magnitude of ? | ω ( t ) | Using this representation, any movement of COM is due to the linear velocity and angular velocity spins the object around COM.
Angular velocity Linear position and velocity are related by v ( t ) = d dt x ( t ) How are angular position (orientation) and velocity related?
Angular velocity How are and related? ω ( t ) R ( t ) Hint: Consider a vector at time t specified in world space, how do c ( t ) ˙ we represent in terms of ω ( t ) c ( t ) ω ( t ) | ˙ c ( t ) | = | b || ω ( t ) | = | ω ( t ) × b | ˙ c ( t ) = ω ( t ) × b = ω ( t ) × b + ω ( t ) × a ˙ b c a c ˙ c ( t ) = ω ( t ) × c ( t )
Angular velocity Given the physical meaning of , what does each R ( t ) column of mean? ˙ R ( t ) At time t , the direction of x-axis of the rigid body in world space is the first column of R ( t ) r xx r xy r xz At time t , what is the derivative of the first column of ? R ( t ) ˙ r xx r xx = ω ( t ) × r xy r xy r xz r xz
Angular velocity r xx r yx r zx ˙ R ( t ) = ω ( t ) × ω ( t ) × ω ( t ) × r xy r yy r zy r xz r yz r zz This is the relation between angular velocity and the orientation, but it is too cumbersome We can use a trick to simplify this expression
Angular velocity Consider two 3 by 1 vectors: a and b , the cross product of them is a y b z − b y a z a × b = − a x b z + b x a z a x b y − b x a y Given a , let’s define a * to be a skew symmetric matrix 0 − a z a y 0 a z − a x 0 − a y a x 0 − a z a y b x then = a × b a ∗ b = a z − a x b y 0 − a y a x b z 0
Angular velocity r xx r xx r yx r yx r zx r zx ˙ ˙ R ( t ) = R ( t ) = ω ( t ) × ω ( t ) ∗ ω ( t ) ∗ ω ( t ) × ω ( t ) ∗ ω ( t ) × r xy r xy r yy r yy r zy r zy r xz r xz r yz r yz r zz r zz = ω ( t ) ∗ R ( t ) Vector relation: ˙ c ( t ) = ω ( t ) × c ( t ) Matrix relation: ˙ R = ω ( t ) ∗ R ( t )
Perspective of particles • Imagine a rigid body is composed of a large number of small particles � • the particles are indexed from 1 to N � • each particle has a constant location r 0i in body space � • the location of i- th particle in world space at time t is r i ( t ) = x ( t ) + R ( t ) r 0 i
Velocity of a particle r ( t ) = d ˙ dt r ( t ) = ω ∗ R ( t ) r 0 i + v ( t ) = ω ∗ ( R ( t ) r 0 i + x ( t ) − x ( t )) + v ( t ) = ω ∗ ( r i ( t ) − x ( t )) + v ( t ) r i ( t ) = ω × ( r i ( t ) − x ( t )) + v ( t ) ˙ angular component linear component
Velocity of a particle r i ( t ) = ω × ( r i ( t ) − x ( t )) + v ( t ) ˙ y 0 ω ( t ) ω ( t ) × ( r i ( t ) − x ( t )) r i ( t ) v ( t ) x ( t ) r i ( t ) ˙ y x 0 z 0 v ( t ) x z
Quiz • True or False � • If a cube has non-zero angular velocity, a corner point always moves faster than the COM � • If a cube has zero angular velocity, a corner point always moves at the same speed as the COM � • If a cube has non-zero angular velocity and zero linear velocity, the COM may or may not be moving
• Position and orientation � • Linear and angular velocity � • Mass and Inertia � • Force and torques � • Simulation
Mass The mass of the i- th particle is m i N � Mass M = m i i =1 � m i r i ( t ) Center of mass in world space M What about center of mass in body space? (0, 0, 0)
Quiz Proof that the center of mass at time t in word space is x ( t ) � m i r i ( t ) = M = x ( t )
Inertia tensor Inertia tensor describes how the mass of a rigid body is distributed relative to the center of mass 2 3 0 2 0 2 m i ( r iy + r iz ) − m i r 0 ix r 0 − m i r 0 ix r 0 iy iz X 0 2 0 2 I = − m i r 0 iy r 0 m i ( r ix + r iz ) − m i r 0 iy r 0 6 7 ix iz 4 5 0 2 0 2 − m i r 0 iz r 0 − m i r 0 iz r 0 m i ( r ix + r iy ) i ix iy r ′ i = r i ( t ) − x ( t ) I ( t ) depends on the orientation of a body, but not the translation For an actual implementation, we replace the finite sum with the integrals over a body’s volume in world space
Inertia tensor • Inertia tensors vary in world space over time � • But are constant in the body space � • Pre-compute the integral part in the body space to save time
Inertia tensor Pre-compute I body that does not vary over time m i r 0 2 2 3 2 m i r 0 ix r 0 m i r 0 ix r 0 3 1 0 0 ix iy iz X m i r 0 T m i r 0 2 i r 0 I ( t ) = 0 1 0 m i r 0 iy r 0 m i r 0 iy r 0 5 − 4 4 5 i ix iy iz m i r 0 2 0 0 1 m i r 0 iz r 0 m i r 0 iz r 0 ix iy iz � m i ( r ′ T i r ′ T i r ′ i ) 1 − r ′ I ( t ) = i ) m i (( R ( t ) r 0 i ) T ( R ( t ) r 0 i ) 1 − ( R ( t ) r 0 i )( R ( t ) r 0 i ) T ) � = 0 i R ( t ) T ) 0 i r 0 i ) R ( t ) T 1 − R ( t ) r 0 i r T � m i ( R ( t )( r T = �� � m i (( r T 0 i r 0 i ) 1 − r 0 i r T R ( t ) T = R ( t ) 0 i ) I ( t ) = R ( t ) I body R ( t ) T � m i (( r T 0 i r 0 i ) 1 − r 0 i r T I body = 0 i ) i
Inertia tensor Pre-compute I body that does not vary over time m i r 0 2 2 3 2 m i r 0 ix r 0 m i r 0 ix r 0 3 1 0 0 ix iy iz X m i r 0 T m i r 0 2 i r 0 I ( t ) = 0 1 0 m i r 0 iy r 0 m i r 0 iy r 0 5 − 4 4 5 i ix iy iz m i r 0 2 0 0 1 m i r 0 iz r 0 m i r 0 iz r 0 ix iy iz � m i ( r ′ T i r ′ T i r ′ i ) 1 − r ′ I ( t ) = i ) m i (( R ( t ) r 0 i ) T ( R ( t ) r 0 i ) 1 − ( R ( t ) r 0 i )( R ( t ) r 0 i ) T ) � = 0 i R ( t ) T ) 0 i r 0 i ) R ( t ) T 1 − R ( t ) r 0 i r T � m i ( R ( t )( r T = �� � m i (( r T 0 i r 0 i ) 1 − r 0 i r T R ( t ) T = R ( t ) 0 i ) I ( t ) = R ( t ) I body R ( t ) T � m i (( r T 0 i r 0 i ) 1 − r 0 i r T I body = 0 i ) i
Approximate inertia tensor • Bounding boxes � • Pros: simple � • Cons: inaccurate
Recommend
More recommend