10.08.2013 Views

thesis - Computer Graphics Group - Charles University - Univerzita ...

thesis - Computer Graphics Group - Charles University - Univerzita ...

thesis - Computer Graphics Group - Charles University - Univerzita ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

46 CHAPTER 5. RIGID BODY DYNAMICS<br />

Second Law for particles and rigid bodies can thus be imagined as special particles with timevarying<br />

masses M(t) that move in R 6 .<br />

The formulation of rigid body dynamics with mass matrices will become very useful when<br />

the equations for constrained rigid body dynamics are developed because we will be able to reuse<br />

derivations from constrained particle dynamics that were formulated in terms of mass matrices<br />

for particles.<br />

5.2.4 Numerical Issues<br />

If we actually tried to simulate a rigid body, say according to (5.18), we would experience a<br />

numerical drift which would mostly affect the representation of the body orientation R(t). The<br />

problem is that rigid bodies have 3 rotational degrees of freedom but rotation matrices R(t) have<br />

3 × 3 DOFs and the extra DOFs have to be neutralized by 6 additional conditions on the matrix<br />

rows, known as the orthogonality conditions. While updating R(t), orthogonality conditions<br />

are violated and the matrix must be “orthogonalized” in order to represent a rotation again.<br />

Whenever the normalization takes place, rigid body state is changed directly, which makes it a<br />

new initial state and the ODE solver must be restarted.<br />

There is, however, a better way to represent body orientations — by the use of unit quaternions,<br />

represented as [scalar = s, −−−−→<br />

vector = (v1, v2, v3)] pairs. Quaternions, unlike rotation matrices,<br />

have 4 DOFs and the extra DOF is neutralized by a condition that requests that the<br />

quaternion must have a unit length. Since there is only one constrained DOF, orientations represented<br />

by unit quaternions experience much less numerical drift than rotation matrices and the<br />

stabilization of the corresponding ODE is much simpler (corresponds to the normalization of the<br />

quaternion). We will assume that the reader is acquainted with quaternions and the representation<br />

of rotations by unit quaternions and present a modified equation of motion for a single rigid<br />

body straight off (one might read [1] to get introductory level information on quaternions). A<br />

variant of (5.18) with a different block row due to orientation representation by a quaternion is<br />

shown<br />

∂<br />

y(t)<br />

∂t<br />

=<br />

∂<br />

∂t (x(t), q(t), P (t), L(t))<br />

= (v(t), 1<br />

2 · [0, ω(t)] · q(t), Ftotal(t), τtotal(t)),<br />

where q(t) = [cos(α/2), sin(α/2) · v] is a unit quaternion that represents the body orientation by<br />

a rotation about axis v by angle α. To utilize previous equations expressed in terms of R(t),<br />

one might consider R(t) as an additional auxiliary quantity, computed from the quaternion q(t).<br />

Derivations can be found in [10].<br />

5.3 Abstraction<br />

In this section we will cover the abstraction and representation of rigid bodies and external<br />

forces that may act upon them. The abstractions generalize and built on top of the previous<br />

abstractions of particles and force objects described in the particle dynamics chapter.<br />

We already know that the simulation of rigid bodies and particles corresponds to the numerical<br />

solving of the corresponding equations of motion, which are coupled ODEs. Since we have got<br />

multiple forms of equations of motion to choose from, we have to decide what variant of the<br />

equation of motion is to be used to drive the simulation and then implement the functions required<br />

by the ODE solver (see page 13) accordingly. The simulation of rigid bodies conceptually follows

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!