Quaternions (Advanced Methods in Computer Graphics) Part 4

Rotation Interpolation

Animation sequences commonly use interpolated values between two poses. A pose defines the position and orientation an object. Position interpolation can be carried out either by interpolating between the corresponding coordinate values, or by fitting parametric curves (splines) through the points. However, interpolation between two orientations in three-dimensional space need not always produce a smooth transition from one orientation to another. Depending on the mechanism we use for representing rotations, we can get completely different interpolation sequences between the same initial and target orientations. Generally, one would prefer an interpolation that yields an optimal path that gives minimum rotation and uniform angular velocity between two configurations. In this section, we will compare different interpolation methods using different representations of rotation we have considered so far, and establish that quaternions have a clear advantage over others.

Initial configuration and two orientations of an object


Fig. 5.8 Initial configuration and two orientations of an object

We define orientation as the result of a rotational transformation from the initial configuration of an object to its current configuration. A configuration is uniquely specified by an orthogonal system of axes fixed on the object. Some of these concepts are explained in a little more detail below with the help of an example. Figure 5.8 shows a simple model, “Hammer”, constructed using four primitives, a cylinder, a cone, a sphere and a cube. The figure also shows two orientations of this model.

The initial configuration of the object defines its orientation when no rotational transformation is applied. In this configuration, an orthogonal right-handed system of body-fixed axes OxByBzB coincides with the inertially fixed coordinate reference axes OXYZ. Without any loss of generality, we can assume that all rotations take place about the origin. The unit vectors along body fixed axes have components xB = (1,0,0),yB = (0,1,0), zB = (0,0, 1) in the initial configuration. An orientation can be uniquely defined using the transformed components of these three vectors. For example, Orientation-1 in Fig. 5.8 is defined by the vectors xB = (0, 0, 1), yB = (—1, 0, 0), zB = (0, —1, 0). During any rotational transformation the tips of these vectors move on a unit sphere centered at the origin (Fig. 5.9a).

The rotational transformation of an object can thus be visualized using the trace of the unit vectors along the body-fixed axes on a unit sphere. Any unit vector has a spherical parameterization in terms of its azimuth (or longitude) a, and elevation (or latitude) ß (Fig. 5.9). The variation of the tip of a vector v = (xv, yv, zv) on a unit sphere can be conveniently represented as a 2D-graph of the values (a, ß) computed as follows:

tmpc2f9-248_thumb[2][2]_thumb

 

Spherical parameterization of rotations: (a) Movement of unit vectors attached to body axes during a rotation of the object. (b) Parametric representation of unit vectors on a sphere

Fig. 5.9 Spherical parameterization of rotations: (a) Movement of unit vectors attached to body axes during a rotation of the object. (b) Parametric representation of unit vectors on a sphere

Table 5.1 Graph values (a,ß) of the two orientations in Fig. 5.8

Orientation-1

Orientation-2

xb

(0,0)

(±180, 0)

yB

(-90, 0)

(~, 90)

zb

(~, -90)

(90, 0)

Transformation matrix

tmpc2f9-250_thumb[1] tmpc2f9-251_thumb[1]

~indicates an indeterminate value

We call the above method of representing the three-dimensional variations of a unit vector as the aß-graph method. Note that when ß = ±90°, the value of a is indeterminate. In the following sections, we will use aß-graphs of the body-fixed axes for a given interpolation sequence to compare the paths generated by different methods. For the example given in Fig. 5.8, the graph values (in degrees) of Orientation-1 and Orientation-2 are shown in Table 5.1. The variation of a graph between the two points will help us visualize how a sequence of rotational transformations operates on an object for transforming it from one orientation to the other.

Another method for visualizing three-dimensional rotations is to show a small triangle (see Fig. 5.9a) at the position of one of the body axes (say, zB) on the unit sphere, oriented towards another axis (say yB). The triangle uniquely represents the three-dimensional orientation of the object. Triangles displayed at equal time intervals during a rotational transformation will clearly show the movement of an axis of interest, and also indicate the spin of the object about that axis (see Fig. 5.10).

Euler Angle Interpolation

Let us first consider the interpolation between two orientations represented using Euler angles. For our example, we will use the Euler angle sequence { , ¢, 6g introduced in Sect. 5.4.1.

Interpolation sequence generated using Euler angles (90, —90, 0) and (0, 90, 0)

Fig. 5.10 Interpolation sequence generated using Euler angles (90, —90, 0) and (0, 90, 0)

Given two sets of Euler angles f f 1, $ 1, 61g and f f 2, $2, 62}, all intermediate sets can be obtained using a linear interpolation between the corresponding Euler angles:

tmpc2f9-253_thumb[2][2][2]

The transformation matrix in Eq. 5.30 then defines the rotation from the initial configuration to the intermediate orientation. Earlier in Fig. 5.5, we saw examples of interpolation sequences generated in this manner. For the example given in Fig. 5.8, Orientation-1 is defined by Euler angles f f 1 = 90, $ 1 = —90, 61 = 0}, and Orientation-2 by f f 2 = 0, $2 = 90, 62 = 0}. The aß-graph for the interpolation sequence is given in Fig. 5.10. For this specific example, linear interpolation in the domain of Euler angles also generates a perfect linear interpolation in aßspace, consisting of equidistant points. However, when we look at the trace of the hammer’s axis from — Y direction to +X direction on the surface of the unit sphere, we observe that the rotational motion from the source to the destination in threedimensional space is not uniform.

The “Hammer” example in Fig. 5.8 also presents an interesting aspect of Euler angles. Orientation-2 can have an infinite number of Euler angle representations given by f f 2 = X, $2 = 90, 62 = X} where X is any value. Thus between the same two orientations, we can have several interpolation paths using Euler angles. As an example, the interpolated values obtained using X = —170° give a distinctly different and curvilinear path between Orientation-1 and Orientation-2, as shown in Fig. 5.11.

Axis-Angle Interpolation

The equivalent angles and axes of rotation for both Orientation-1 and Orientation-2 can be computed from the corresponding transformation matrices using Eq. 5.41.

Interpolation sequence generated using Euler angles (90, -90, 0) and (-170, 90, -170)

Fig. 5.11 Interpolation sequence generated using Euler angles (90, -90, 0) and (-170, 90, -170)

Interpolation sequence generated using the angle-axis transformation

Fig. 5.12 Interpolation sequence generated using the angle-axis transformation

The parameters for Orientation-1 are 11 = 120°, l1 = 0.57735, m1 = -0.57735, n1 = 0.57735, and for Orientation-2 the values are 12 = 90°, l2 = 0, m2 = 1, n2 = 0. A straightforward linear interpolation gives

tmpc2f9-256_thumb[2][2][2]

The interpolated vector will need to be normalized before constructing the transformation matrix in Eq. 5.38. The intermediate orientations generated using the above equation are shown in Fig. 5.12.

In the example shown above, the angle axis transformation generates a nonuniform motion with a large variation in the angular velocity. As can be seen from both the aß-graph and the trace on the sphere, the density of points around the source and the destination points is very large compared to the middle. The parameters used in the interpolation belong to completely different domains, the angle being a scalar and the axis of rotation being a vector. Quaternions help us to eliminate this disparity in the type of the interpolants, and achieve a rotation where both the axis of rotation as well as the rate of change of angle remain constant. In the next section, we consider a linear interpolation using quaternions.

Interpolated and unit quaternions on a unit sphere in quaternion space

Fig. 5.13 Interpolated and unit quaternions on a unit sphere in quaternion space

Next post:

Previous post: