Interpolating solid orientations with circular blending ...

14
Computer-Aided Design, Vol. 27, No. 5. DP. 385398, IS95 Cowriaht f> 1995 Elsevier Science Ltd Printed’in &ea;Britain. All rights reserved 001&4lS5/95 $10.00+0 00 Interpolating solid orientations with circular blending quaternion curves Myung-Soo Kim and Kee-Won Nam The paper presents a method to smoothly interpolate a given sequence of solid orientations using circular blending quaternion curves. Given three solid orientations, a circular quaternion curve is constructed that interpolates the three orientations. Therefore, given four orientations qi- t, qi, qi+ r, qi + z, there are two circular quaternion curves Ci and Ci + 1 which interpolate the triples of orientations (qi-l. qi. qi+J and (qi. qi+ 1, qi+ *), respectively; thus, both Ci and Ci+ I interpolate the two orientations qi and qi+ 1. Using a method similar to the parabolic blending of Overhauser, quaternion curve Q,(t) is generated which interpolates two orientations qi and qi+l while smoothly blending the two circular quaternion curves C,(t) and Ci+r(t) with a blending function f(t) of degree (2k - 1). The quaternion curve Qi has the same derivatives (up to order k) with Ci at qi and with Ci+t at qiil, respectively. By connecting the quaternion curve segments Qi in a connected sequence, a Ck-continuous quaternion path is generated which smoothly interpolates a given sequence of solid orientations. Keywords: quaternion curves, rotation, curve blending One of the fundamental problems in computer ammatton is that of how to interpolate a given sequence of positions and orientations (i.e. keyframes) of a rigid body so that the resulting animated motion looks smooth and natural’. For a single 3D solid object, its position and orientation can be uniquely represented by two elements UElR3 and qES0(3), respectively, where lR3 is the 3D Euclidean space and SO(3) is the rotation group’ of lR3. Thus the motion of a single solid object can be uniquely represented as a path in the product space [w3 x SO(3). Given a sequence of position-orientation pairs, i.e. (pi, qi)E: R3 x SO(3), for i= 1, . . ., n, the motion control problem for a given solid object is that of how to control the shape and speed of a smooth path (p(t), q(t))E R3 x SO(3) while interpolating the given sequence of n discrete points (pi, qi). The speed control is done by specifying a Department of Computer Science, POSTECH, Pohang 790-784, Korea Paper received: 19 March 1993. Revised: 5 May 1994 sequence (ti} of strictly increasing time instances so that the path (p(t), q(t)) interpolates each keyframe (pi> qi) at time ti, i.e. p(ti) = pi and q(t,) = qi. Between two adjacent keyframes at ti and ti+l, a total of ((ti+r-ti)/h-1) in-between frames are generated at t = ti + h, ti + 2h, . ., $.; -h, where h= l/24 s for film and l/30 s for video. I we 1 shows a keyframe animation for a 3D character K; keyframes are shown in dark tints and in-between frames are shown as open figures.) Since there are many well known techniques for the construction of the first component p(t) in R3, this paper focuses on the second component q(t) in the non-Euclidean projective space SO(3). Outline of algorithm The rotation group SO(3) is a projective space which is constructed from the unit 3-sphere S3 in [w4 by identifying each pair [q, -q] of two antipodal points q, - q E S3 as a single point qESO(3) (see Reference 3). Each local neighbourhood U of S3 which contains no antipodal points is in one-to-one correspondence with the same neighbourhood U in SO(3); the local geometry of SO(3) is thus identical to that of S3. Since the 3-sphere S3 is more intuitive to understand than the projective space SO(3), all the curve constructions (presented in this paper) are done in S3 and the computational results are projected to the space SO(3). The circular quaternion curve generation method is based on the following simple geometric observations. By cutting the 3-sphere S3 by a hyperplane L3 c R4 which contains the origin of [w4,we get a great 2-sphere S& ( = S3 n L3) which is isomorphic to the standard 2-sphere S2. That is, by rotating the hyperplane L3 into the subspace lR3 embedded in [w4, we can rotate the 2-sphere St, into the standard 2-sphere S*. Furthermore, by cutting the 2-sphere S* with a plane L* c R3 (which may not pass through the origin of rW3), we generate a circle C on the standard 2-sphere S*. Under the inverse rotation of [w3 back to the hyperplane L3, the circle C can be mapped into a circular curve C on the standard 3-sphere S3 in Iw4. Similar arguments apply to the projective spaces SO(3) and SO(2), too. Computer-Aided Design Volume 27 Number 5 May 1995 385

Transcript of Interpolating solid orientations with circular blending ...

Computer-Aided Design, Vol. 27, No. 5. DP. 385398, IS95 Cowriaht f> 1995 Elsevier Science Ltd

Printed’in &ea;Britain. All rights reserved 001&4lS5/95 $10.00+0 00

Interpolating solid orientations with circular blending quaternion curves Myung-Soo Kim and Kee-Won Nam

The paper presents a method to smoothly interpolate a given sequence of solid orientations using circular blending quaternion curves. Given three solid orientations, a circular quaternion curve is constructed that interpolates the three orientations. Therefore, given four orientations qi- t, qi, qi+ r, qi + z, there are two circular quaternion curves Ci and Ci + 1 which interpolate the triples of orientations (qi-l. qi. qi+J and (qi.

qi+ 1, qi+ *), respectively; thus, both Ci and Ci+ I interpolate the two orientations qi and qi+ 1.

Using a method similar to the parabolic blending of Overhauser, quaternion curve Q,(t) is generated which interpolates two orientations qi and qi+l while smoothly blending the two circular quaternion curves C,(t) and Ci+r(t) with a blending function f(t) of degree (2k - 1). The quaternion curve Qi has the same derivatives (up to order k) with Ci at qi

and with Ci+t at qiil, respectively. By connecting the quaternion curve segments Qi in a connected sequence, a Ck-continuous quaternion path is generated which smoothly interpolates a given sequence of solid orientations.

Keywords: quaternion curves, rotation, curve blending

One of the fundamental problems in computer ammatton is that of how to interpolate a given sequence of positions and orientations (i.e. keyframes) of a rigid body so that the resulting animated motion looks smooth and natural’. For a single 3D solid object, its position and orientation can be uniquely represented by two elements UE lR3 and qES0(3), respectively, where lR3 is the 3D Euclidean space and SO(3) is the rotation group’ of lR3. Thus the motion of a single solid object can be uniquely represented as a path in the product space [w3 x SO(3). Given a sequence of position-orientation pairs, i.e. (pi, qi)E: R3 x SO(3), for i= 1, . . ., n, the motion control problem for a given solid object is that of how to control the shape and speed of a smooth path (p(t), q(t))E R3 x SO(3) while interpolating the given sequence of n discrete points (pi, qi). The speed control is done by specifying a

Department of Computer Science, POSTECH, Pohang 790-784, Korea Paper received: 19 March 1993. Revised: 5 May 1994

sequence (ti} of strictly increasing time instances so that the path (p(t), q(t)) interpolates each keyframe (pi> qi) at time ti, i.e. p(ti) = pi and q(t,) = qi. Between two adjacent keyframes at ti and ti+l, a total of ((ti+r-ti)/h-1) in-between frames are generated at t = ti + h, ti + 2h, . .,

$.; -h, where h= l/24 s for film and l/30 s for video.

I we 1 shows a keyframe animation for a 3D character K; keyframes are shown in dark tints and in-between frames are shown as open figures.) Since there are many well known techniques for the construction of the first component p(t) in R3, this paper focuses on the second component q(t) in the non-Euclidean projective space SO(3).

Outline of algorithm

The rotation group SO(3) is a projective space which is constructed from the unit 3-sphere S3 in [w4 by identifying each pair [q, -q] of two antipodal points q, - q E S3 as a single point qESO(3) (see Reference 3). Each local neighbourhood U of S3 which contains no antipodal points is in one-to-one correspondence with the same neighbourhood U in SO(3); the local geometry of SO(3) is thus identical to that of S3. Since the 3-sphere S3 is more intuitive to understand than the projective space SO(3), all the curve constructions (presented in this paper) are done in S3 and the computational results are projected to the space SO(3).

The circular quaternion curve generation method is based on the following simple geometric observations. By cutting the 3-sphere S3 by a hyperplane L3 c R4 which contains the origin of [w4, we get a great 2-sphere S& ( = S3 n L3) which is isomorphic to the standard 2-sphere S2. That is, by rotating the hyperplane L3 into the subspace lR3 embedded in [w4, we can rotate the 2-sphere St, into the standard 2-sphere S*. Furthermore, by cutting the 2-sphere S* with a plane L* c R3 (which may not pass through the origin of rW3), we generate a circle C on the standard 2-sphere S*. Under the inverse rotation of [w3 back to the hyperplane L3, the circle C can be mapped into a circular curve C on the standard 3-sphere S3 in Iw4. Similar arguments apply to the projective spaces SO(3) and SO(2), too.

Computer-Aided Design Volume 27 Number 5 May 1995 385

Figure 1 Keyframe animation of 3D character K

Given a sequence of points qie S3 (i= 1, . . n), each triple (qi_ 1, qi, qi+ I) of three consecutive points determines a unique hyperplane Lf passing through the three points and the origin of iw4. The great 2-sphere St; ( = S3 n L?) contains the three points qi- 1, qi, gi + ]. By rotating the hyperplane Lf into Iw3 (c R4), the great 2-sphere S$ rotates into the standard 2-sphere S2; at the same time, the three points qi _ 1, qi, qi + 1 are mapped into 4i- 17 4i3 4i+ 1 on S’, respectively. The three points qi- 1,

4i, 4i+l determine a plane Lf’ (in lR3) which intersects with S2 in a circle. The two points 4i _ I and 4i + 1 subdivide this circle into two circular arcs; one of them, C, contains the middle point &. The circular arc ci thus interpolates the three points qi- 1, qi, qi+ 1 on SL in that order. Under the inverse rotation of Iw3 (in rW4) back to the hyperplane Lf, the circular curve ci transforms into a circular curve Ci which interpolates the given three points qi _ 1, qt qi + 1 on S3 in that order. In a similar way, a circular curve Ci+ 1 can be constructed that interpolates the next triple (4i3 4i+ 17 qi+ J of three consecutive points on S3. Thus we have two circular curves Ci and Ci+ 1 which interpolate the two points qi and qi+ I.

Using a technique similar to the parabolic blending of Overhauser4 (which is also known as a variant of Catmull-Rom splines5), the two circular curves Ci(t) and Ci + I(t) can be smoothly blended together on S3 (with a blending function f(t) of degree (2k- 1)) to generate a smooth quaternion curve Qi(t) which inferpolates the two endpoints qi and qi + Ir and has the same derivatives (up to order k) with Ci at qi and with Ci+l at qii-1, respectively. (See Figure 2.) By connecting the curve segments Qi in a connected sequence, a Ck-continuous quaternion path Q is constructed that interpolates a given sequence (qi) of keyframe points on S3. Let (ti) be a sequence of strictly increasing time instances associated with the keyframes; then the quaternion path Q(t) is required to interpolate each keyframe qi at time t =ti. For this purpose, the circular curve Ci(t) is first parameterized for ti_ 1 <t Q ti+ I so that it satisfies Ci( ti _ 1) = qi _ 1, Ci(ti) = qi, and Ci(ti + 1) = qi + I. (The circular curve Ci+ 1(t) is also parameterized for ti < t < ti+ 2 in a similar way.) For each t E [ti, ti+ J, the blending at time t is done along the shortest curve segment yt (geodesic on S3) between the two corresponding points Ci(t) and Ci + l(t). The curve point Qi(t) is defined to be the interior point of yf (c S3) which subdivides 7, in the ratio of f(t): 1 -f(t), where f(t) is an increasing function, for ti<t<ti+l, such that f(ti)=O, f(Ti+ 1)~ 1, f”‘(ti)=. . =f(k-l)(ti)=O, and f”‘(ti+l)=.,.=f’k-“(ti+l)=O, for

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

some positive integer k. For k= 1, a linear blending function f(t) is given by f(t) = (t - ti)/(ti+ 1 - ti); for k = 2, a cubic polynomial blending function f(t) is given by ,f(t) = (t - tJ2 . (3ti + I - ti - 2t)/(ti+ 1 - tJ3. In general, for a blending function f(t) of degree (2k- l), the blending curve Qi(t) has the same derivatives (up to order k) with Ci at qi and with Ci+l at qi+ lr respectively. Thus the connected sequence of Qis becomes a Ck-continuous spline curve Q on S3. The geodesic curve segments 7, are great circular arcs of radius 1 which have their common centre at the origin of [w4; the geodesic arcs are generalizations to S3 of the line segments in R3. Any geometric computations based on line segment con- structions in [w3 can be easily extended to S3 by using the ‘geodesic arcs instead of line segments in the construction algorithm.

Previous work

The geodesic arc on S3 (or SO(3)) is also called a slerp in computer graphics (following its first usage by Shoemake’, who introduced the quaternion to the computer graphics community). In the de Casteljau algorithm, each point on a cubic B6zier curve is generated by successively subdividing six line segments (see Reference 7). Generalizing this construction algorithm to the non-Euclidean space SO(3), Shoemake generates each point on a cubic BCzier quaternion curve by using six slerps on SO(3). Schlag’ extends the recursive subdivision algorithm of Barry and Goldman9 to generate a class of Catmull-Rom spline quaternion curves (which includes the BCzier, B-spline, and cardinal spline curves as important subclasses); this algorithm also uses six slerps. Although it has C2 continuity, a B-spline quaternion curve does not pass through the control points8”‘. Nielson and Heiland’ 1 overcome this drawback by computing the control points on SO(3) for a B-spline quaternion curve so that the curve interpolates a given sequence of keyframe quaternion knot points on SO(3); however, the computation requires a time-

Figure 2 Blending IWO circular quaternion curves

386 Computer-Aided Design Volume 27 Number 5 May 1995

consuming iterative numerical method to approximate the control points.

Shoemake” extends the Boehm quadrangle scheme13 to a cubic quaternion curve (called a squad (spherical quadrangle)), but using only three slerps. Although the squad methodi is computationally more (about twice as) efficient than the Btzier method6, the rotational motions generated by squad curves are not as smooth as those generated by the spherical BCzier curves. Pletinckx14 suggests an efficient algorithm to construct approximate cardinal spline and tensioned B-spline quaternion curves by recursively generating the middle point of each curve segment. The total number of middle points (i.e. in-between points) generated in this method is always of the form 2’- 1 for some positive integer i>O; this is a severe restriction for keyframe animation systems in practice.

All the above methods are based on the construction of geodesic arcs on S3 (which are great circles of radius 1). The circle methods of Nielson and Shieh” and Wang and Joel6 use circular quaternion curves on S3 (which are not necessarily great circles) to interpolate solid orientations. Since the circles on S3 can be represented exactly as rational quadratic Bbier curves in R4, the rational spline techniques in R4 can be used to generate a sequence of circular quaternion curves connected with C’ continuity. The circle methods15*‘6 are computation- ally more efficient than other methods; however, they have many limitations in terms of flexibility. Since each circular curve is a planar curve, at each junction of two circular curves, a large angular acceleration/torque is generated that would cause undesirable effects for the smooth animation of a moving 3D solid”. In this paper, to overcome such a drawback, two circular curves are smoothly blended together on S3 by a polynomial blending function of degree (2k- l), and a quaternion curve is generated on S3 so that two adjacent quaternion curves meet with CL continuity.

One might think a quaternion curve of degree (2k + 1) would be generated by blending two circular curves by a polynomial blending function of degree (2k- 1). However, the question is that of what the degree of a quaternion curve is on S3. The circle methods15y’6 have a clear answer to this question since they generate rational quadratic curves (of degree 2) in R4. However, other quaternion curves (defined by slerp constructions) do not have any polynomial representations; they are analytic curves for which no algebraic degree is defined. Therefore, raising the degree of a blending function does not greatly deteriorate the computational simplicity/ efficiency of a circular blending quaternion curve. The more important factor is that of how many recursive steps of slerp constructions are applied to generate each quatemion curve point in S3. The more recursive steps are used, the more difficult it is to derive the differential properties of a quaternion curve. The circular blending method uses only one slerp construction to generate each quaternion curve point; thus it is relatively easy to derive the differential properties of the curve. This greatly simplifies further extensions of the curve construction method, for example, the circular blending method can be easily extended to generate a hermite interpolation quaternion curve on S3 (see Reference 18). More details of this are discussed in the fourth section of the paper.

Organization of paper

The rest of this paper is organized as follows. In the second section of the paper, a construction method is presented that generates circular quaternion curves on S3 and SO(3). In the third section, two circular quaternion curves are blended together to generate a Ck-continuous quaternion path which smoothly inter- polates a given sequence of solid orientations. In the fourth section, comparisons are made with other methods, and the relative advantages of our method are explained. Finally, in the fifth section, we conclude the paper.

CIRCULAR CURVES IN S3

In this section, we consider the problem of how, given three points pl, p2, p3 E S3, to construct a circular curve (in S3) which interpolates the three points.

Great circle in 9

In 3D Euclidean space R3, given two points, pl, p2 E S2, there is always a great circle C which connects the two points. The circle C is the intersection curve between the unit sphere Sz and the plane L which contains the two points p1 and p2, and the origin of R3. Since the two vectors pl and p2 are parallel to the plane L, the vector n,=(p, xp2)/I(pl xp,(l is a unit normal to the plane L. Let n, = nP x pl; then the three vectors pl, n,, nP form an orthonormal basis, and the matrix

T=CP, n2 nplT

defines a rigid transformation (i.e. the rotation of L into R2) which maps the orthonormal unit vectors pl, n2, nP into the standard unit vectors e, =(l, 0, 0), e, =(O, 1, 0), e3 = (0, 0, l), respectively. (Note that, in this paper, the vectors are interpreted as column or row vectors depending on the context.) Thus, under this rigid transformation, the circle C is transformed into the standard unit circle S’ in the 2D Euclidean plane R2. Further computations can be done on the unit circle S’ and the results can be mapped back to the original curve C in S2 by using the inverse transformation

T--l =TT=[pl n2 n,,]

Great sphere in 9

Using a conceptual similarity to the great circle (interpolating two points) on the unit sphere S*, we consider how to construct a great 2-sphere S which interpolates three points pl, p2, p3 ES~ in the 4D Euclidean space R4. First, we construct the hyperplane L3cR4 which contains the three points pl, pz, p3 and the origin of R4. The hyperplane L3 is defined in the form

a.x+b.y+c.z+dew=O

where the 4D normal vector (a, b, c, d) is given by the

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

Computer-Aided Design Volume 27 Number 5 May 1995 387

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

t

T1sf-l-l followed by

the translation by p,,

1. 0)

Figure 3 Construction of circular curve interpolating three points on S”

relation

where e, =( 1, 0, 0, 0), Y?=(O, I, 0, 0), e3 =(O. 0. I, 0), e4 = (0, 0, 0, l), and pi = (Xi, yi, zi, wJ, for I’ = 1, 2. 3, 4.

We denote the above ternary operation as p1 x pZ x p3 which computes the 4D normal vector (a, h, C, d) from the given three 4D vectors pl, pZ, p3. By normalizing the 4D vector (a, h, C, d), we obtain a unit 4D vector 114=(a, b, L’, d)lll(a, h, c, djll.

Let ~~~=~P~~~~~P~~/IIP~~~~~P~II and n3=a4x

p1 x n,; then the four 4D vectors pl, n4, n,, n3 form an orthonormal basis. (Note that n4 x p1 x n2 is a unit 4D vector since the three vectors n4, pl, n, are orthonormal; thus we do not need to normalize the vector n4 x p1 x n, to obtain a unit 4D vector n3.) The transformation

T=Cp, n2 n3 n41T

rotates L3 into R3; thus T maps the three points pl, pz, p3 into the 3D Euclidean subspace R3 ( cR4) which is generated by the first three unit vectors e, =( 1, 0, 0, 0), e, =(O, 1, 0, 0), e3 =(O, 0, 1, 0). Since the transformation T is an orthogonal matrix, the transformation preserves the lengths of the three vectors3; that is, the transformed

translate by

-PO I

three points PI = T(p,), p2 = T(pJ, p3= T(p,) are on the standard unit sphere S* of R3. Note that ~7~ =el = (1, 0, 0, 0). Moreover, the three points PI, p2, p3 can be mapped back into the original three points pI, p2, p3

under the inverse transformation

T- ’ = TT=[pl n, n3 n,]

Let Si, = TP ‘(S2) be the mapping of the unit sphere S2 into the 3-sphere S3 (c R”) under the inverse transformation T-‘; then one can easily show that the great 2-sphere S, 2~ is the intersection S3n L3, and the sphere Szl contains the three points pl, p2, p3.

When we restrict the domain of the inverse transformation T-l to R3, the last column n4 is redundant. This is because any 4D vector (x, y, z, w) in the subspace R3 has the last coordinate w=O. Thus, we ignore the last row of T and the last column of T-‘, and write

T=[p, n2 n31T

and

TV ‘=CP~ n2 n31

Circular curve in S3

The three points p,, p2, p3 on the unit sphere S2 (see Figure 3) determine a plane L2 (c R3) which does not necessarily contain the origin of R3. (Note that PI = I?, =

388 Computer-Aided Design Volume 27 Number 5 May 1995

(1, 0, O).) The intersection of the plane L2 with the sphere S2 determines a circle C which interpolates the three points PI, p2, p3 on the sphere S2. The inverse transformed circle C= T-‘(c) generates a circular curve which interpolates the three points pl, pz, p3 E S3; we denote the circle C as C(p,, p2, p3). Note that the circles c and C do not have their centres at the origins of R3 and R4, respectively. Let &, be the centre of c, then the translated circle C-p, has its centre at the origin of R3 and it is contained in the translated plane L2 -PO. Under the inverse transformation T- ‘, this circle C-P, is transformed back to R4 as

solving the equation

a(at - 1) + b(bt) + c(ct) = 0

that is, a

t= a2+b2+c2

=a

Thus, we have &, = a -(a, b, c) = (a’, ab, ac). The orthogonal transformation T is constructed as

follows. Let

T-‘.(C_p,)=T-‘.C-T-‘.ii,=C-T-‘.p, n _ P1-PO (1 -a’, - ab, - ac)

1-~~~1-~o~~=((1-a2)2+a2~b2+a2~c2)1~2

and Thirs, to compute the circular curve C on S3, we need to add the 4D vector T-l .jjo~ R4 to the inverse transformation T- ’ .(C- PO) of the circle c--p0 centred at the origin of R3. Let p. denote the vector T- ’ .jjo.

Let T be the orthogonal transformation which rotates the circle C-D, (on the plane L2 -pot R3) into a circle c (on the 2D plane lR2 c R3), and let S be the scaling of R2 which expands the circle c into the unit circle S’. Furthermore, let 7 denote the composition S. T then the transformation $ maps the circle c--p, into the unit circle S’. Let #’ denote the transformed 2D vectors ? .(pi - PO), for i = 1,2,3. (Note that we can easily choose a transformation T so that the resulting transformation $ maps the 3D vector p, -PO into the unit 2D vector fil =sl =(l,O)~sl.) Thus, the unit circle S’ can be transformed back to the circle C(p,, p2, p3) ( cS3) under the inverse transformation T- ’ . $- ’ followed by the translation of po. Each point on the unit circle S1 is represented as -(cos 8, sin 0)~ lR2, for 0~ 0G2n. The composite matrix T- ‘. T- ’ is a 4 x 2 matrix. Once the composite matrix T- ’ . ii-l and the point p. are known, each point fi E S’ can be mapped into the corresponding point p E C(p,, p2, p3) c S3 by computing one cosine, one sine, eight multiplications, and eight additions. We explain how to construct the point PO and the transformations $ and $- ’ in the following.

The centre PO of the circle c can be computed as follows. First, we compute the unit normal n3 of the plane L2 by using

n3= (P2--P1)x(~3-t%) (P2 - ?I) x (P3 -2,)

IKP2 -PA x (P3 -PJl= Il(P2 -PI) x (P3 -eAll

(P2 -(l, &ON x (P3 --(LO, 0))

= ll(P2 -6 0, 0)) x (P3 -(L 0, W/I

Let n3 = (a, b, c) E R3; then the centre PO of the circle C is the intersection point of the line

l(t) = (at, bt, ct)

with the plane L2. Since the point fil =(l, 0,O) is on the plane L2 and the unit vector (a, b, c) is the normal direction of L2, the plane equation of L2 is given by

a(x-l)+by+cz=O

The parameter t for the point PO= I(t) is obtained by

iiz=fi3Xii,

Then the transformation matrix T is given by

T=[“1 n2 ii,]T

and the inverse transformation matrix T-’ is given by

T- I= TT= [jjl fi, fi,]

Using an argument similar to the one given at the end of the subsection on the great sphere in S3, we can ignore the last row of T and the last column of T- I, and write

T=[i& Fi2]T

and

T- 1= TT’ [fit Z2]

Let ~=((l-a~)~+a~.b~+a~.c~)~‘~. 9 then the scaling transformation S is given by

s= l/s 0

[ 1 0 l/s

and the inverse scaling transformation S-’ is given by

s-1= s O

[ 1 0 s Thus, the composite transformation matrix T= S. T is given by

$=s. T=[(l/s).ii, (l/s)&J’

and the inverse transformation matrix 7-l is given by

~-‘=(S.T)-‘=T-‘.S-‘=~T.S-l

=[s.& s.n,]=[&-po ti3X(&-Po)]

Circular quaternion curves in W(3)

The circular curve C= C(p,, p2, p3) in S3 generates a similar circular curve QC(p,, p2, p3) in SO(3) under the projection which identifies each pair of two antipodal

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

Computer-Aided Design Volume 27 Number 5 May 1995 389

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

points in S3 as a single point in SO(3). Given three orientations ql, q2, q3 ~S0(3), there are three pairs of points C4i, - qJ, Cq2, -qJ, Cq3, - q31 in S3 which are identified with ql, q2, q3, respectively. There are eight different sequences ( + ql, + q2, + q3) of three points f q,, +q2, Sq3 in S3; each sequence generates a circular curve C() q,, f q2, + q3) in S3. Among the eight circular curves in S3, there are four pairs of two antipodal curves; each pair is identified with a single circular curve in SO(3). For example, the pair of two antipodal circular curves C(q,, q2, q3) and C(-q,, -q2, -q3) on S3 is identified with a curve QC(q,, q2, q3) on SO(3). Thus we may assume that the four circular curves in SO(3) are given in the form QC(ql, + q2, + q3). One may take any of the four circular curves QC(q,, 5 q2, k q3) in SO(3) for the purpose of interpolating the given three orientations ql, q2, q3 E SO(3). One natural choice which works well in most applications is to take the circular curve QC(q,, f q2, f q3) which has the shortest curve length; however, in some situations, depending on the purpose of animation, it might be better to choose one from the other three circular curves (also see Reference 19).

where O< tic 1. When we subdivide the two circular curves C! and C: into rn/ and rn: in-between subsegments, respectively, a strictly increasing smooth angular function O(t), for O< t < 1, which satisfies the condition

e(o) = 0

e(ti) = e;

and

H(l)= 1

is given by

e(t) = tx

where the constant x > 0 is determined by the condition

CIRCULAR BLENDING QUATERNION CURVES IN SO(3)

In this section, we consider how to smoothly blend the two circular quaternion curves Ci and Ci+l (both of which interpolate the two quaternions qi and qi+ 1) into a quaternion curve Qi so that Qi has the same derivatives (up to order k) with Ci at qi and with Ci+ 1 at qi+,, respectively. In the first subsection, each circular curve Ci is parameterized so that it interpolates the quaternions qi_l, qi, qi+l at time ri-,, ti, ti+l, respectively. In the second subsection, we show that the blending curve Qi has the same derivatives (up to order k) with Ci at qi and with Ci + 1 at qi + , , respectively.

a=iOg(e!)/iOg A- = ( > bat9 m!+mz log rn! - log(m! + mf)

Thus we have

Furthermore, each value O(t) = ta is computed by

d(t) = exp(a . log t)

Parameterization of circular curves

We consider how to parameterize the curve CJt), for ti-1 <ci<ti+i, so that is can interpolate the quaternions qi_ 1, qi, qi+ 1 at time ti_ i, ti, ti+ r, respectively. Let C! (respectively Cz) be the subsegment of Ci which connects the two quaternions qi _ 1 and qi (respectively qi and 4; + 1). Suppose the angular domains of the circular curve segments C! and Cf are the angular intervals [0, &!] and [ej, (3: + @J, respectively. By linearly resealing the angular domains of C,! and Cf, we may assume

Since the computation of O(t) (for rn/ + rnf different values of t) as an exponential function t” requires (m/ +mf) log and exp computations which are quite expensive, we replace the exponential function with a low degree polynomial, mostly with a degree 2 or 3 polynomial, for reasonable ranges of 0 < ti < 1 and O< ei < 1 values. Consider a quadratic polynomial

H(t)=crr2+bt+c

o<e;<e;+e+i

Furthermore, by reparameterizing t, we may assume ti_,=O and ri+r = 1; thus we have

ci(o) = 4i - 1

ci(ti) = 4i

and

ci(l)=qi+ 1

which satisfies

H(0) = 0

H(f,) = e;

and

H(l)= I

For this polynomial, we have

L.=e(o)=o

rr+h=H(l)= I

and

N; =e(t,~=~tf +(I -~)t,=(tf- tila+ti

390 Computer-Aided Design Volume 27 Number 5 May 1995

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

er ,

8’ 8’

*. ‘\

‘. \ \ \ \ \ \ \ ‘\

‘\ -*.

0' 4 1 * t

8‘ I’

I

I’

(4 (b) Figure 4 Low degree polynomials; (a) BAt)=at2+(1--)t, (b) B,(r)=at3+(1 -n)t’

Thus we have

e;-ti a=-

tf - ti

and

e; -tf a-l=.-.---

t: - ti

(In the degenerate case of a = 0 (i.e. 0: = ti), the polynomial O(t) becomes a linear polynomial 0(t)= t.) The quadratic polynomial

e(t) = UP + (1 - a)t

has as its derivative

e,(t)=2at+(l -a)

For the polynomial O(t) to be strictly increasing, for 0~ t < 1, the root of the derivative e’(t)=2at +(l -a) should be ~0 or 2 1 (see Figure 4~); that is, we should have

u-l -<o

2a

or

a-l -21

2a

and, equivalently,

U-l -=-!-L, et-tF <o

2a 2(e! - ti)

01

e;-t: ,1

2(8!’

Thus, for the quadratic polynomial

e(t) = at2 + (1 - a)t

to be strictly increasing for 0 <t < 1, we should have

t:sef62ti-t?

When OK@ < tf, for a certain range of t#, we may use the polynomial

e(t) = d + (1 - gt2

which satisfies the conditions

e(0) = 0

e,(O) = 0

e(i)= i

and

e(ti) = e!

For the polynomial to be strictly increasing, the root of the second derivative P(t) = 6at + 2( 1 -a) should be f 0 (see Figure 46). The root of P’(t)=0 gives the t value for an inflection point. Using a argument similar to that above, we can easily show that the range of 0: should be

tf G ef G t;

Using symmetry, the polynomial

e(t)=a(t-i)3+(a-i~t-i)2+i

satisfies the conditions

e(O)=0

e(l)= 1

Computer-Aided Design Volume 27 Number 5 May 1995 391

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

and

d’(l)=0

thus Ci(t) is also infinitely differentiable. In the case in which 0(t) is a Ck-continuous piecewise polynomial function, Ci(t) is also Ck-continuous; thus the curve Ci interpolates qi- 1, qi, qi+ 1 with Ck-continuity.

For the polynomial to be strictly increasing, and, further, to satisfy the condition

O(Ci) = e; Circular blending quaternion curves in SO(3)

the range of 0; should be

We can use the same procedure for higher degree polynomials; however, the cases which require high degree polynomials are quite rare. For these rare cases, we can use the exponential function 0,(t)= t* without affecting the overall performance of the algorithm significantly.

Given two circular quaternion curves Ci and Ci+ l which interpolate two quaternions qi and qi+l at times ti and

fi+ 1’ respectively, we have

Ci(li)=Ci+I(fi)=qi

and

In the above discussions, we have assumed that 0<8! < 1 (i.e. no two consecutive orientations are identical); however, it is also easy to deal with the degenerate case of qi _ I = qi (respectively q, = qi+ 1). In the degenerate case, the circular quaternion curve (which interpolates the three points qi- Ir qi, qi+ 1) can be easily constructed by the geodesic circular arc which connects the two points qi_, =qi and qi+l (respectively qi_ 1 and q, = qi + 1). When 0: = 0, the two orientations qi- 1 and yi are identical. There is no monotonically increasing polynomial function 0(t) with 6(O) =O, @ti) =O, and 0( 1) = 1. Thus we define a piecewise polynomial function

80 by

:

0 O<tdti

O(t)=

c 1

5 k+l

1 -ri t,<t< I

The circular blending quaternion curve Qi(t), for ti,<1<ri+13 is defined by

Qi(t) =exp(.f(t).log(Ci+ I(t)’ Ci(t)- ‘)). cc(t) = exp((l -.f(r)). l”g(Ci(t) ’ ci+ l(t)- ‘)I’ ci+ l(t)

where f’(t) is an increasing function, for rid t d ti + 1, such that .f(ri)=O, .f(~~+~)= 1, ,f’l’(ti)=...=f’k-l)(ti)=O, and ,f’l’(ti+ 1)=. =fck- l’(ti+ 1)=0, for some positive integer k. (See Appendix A for more details of this definition based on the geodesic great circular arc of S3.) It is trivial to prove that Qi(ti)= Ci(ti)=qi and Qi(ti+ ,)= Ci+ ,(ti+ ,)= q, + 1; that is,

Qi(ti) = exp(0). Ci(ti) = Ci(ti) = qi

for some positive integer k. The function O(t) satisfies the three conditions @(O)=O, &t,)=O, and 0(l)= 1: furthermore, d(r) is Ck-continuous at t = t,.

For the proof of Ql(tJ = Cj( ti), we need to differentiate the expression of Qi(t) given in the above definition. We first differentiate the subexpression on the exponential function:

Similarly, when 0: = 1 (i.e. 0: = 0), the two orientations qi and qi+ 1 are identical. For the given conditions 0(O) = 0, 0(t,)= 1, and 0(l)= 1, we can define’ a monotonically increasing piecewise polynomial function 0(t) by

i

t k+l

0 e(t)= ti

O<t<ti

1 r,<r< 1

for some positive integer k. The function O(r) is also Ck-continuous at 1= li.

exp(.f’(t)‘log(C,+ I(t).Cj(t)U ‘1)

= exp(0, O(t). (&), MO, c.(d)) = (cos H(t). sin @t).(a(t), h(r), c.(t)))

Now, we consider the smoothness of Ci(t) = C,(e(t)). The curve C,(0) is infinitely differentiable with respect to the angle 0 since Ci is given by

where 28(t)~S’ and (u(t), b(t), c(t))ES*, for fidt dti+ 1. (We must apologize for an abuse of the notation O(t). The function H(t) in the above equation is different from the angular function d(t) used to parameterize the circular curve Ci(t) in the previous subsection. The angular function Q(r) here means the angle between the two quaternions Ci(t) and C, + I(t), for ti < t < ri + 1; also see the definition of 19 in Appendix A.) We have

f4t)=(@t), (0, 0, 0))

where T- ‘, T- ‘, and I>(, are the linear coordinate transformations constructed in the subsection on a circular curve in S3. Thus the smoothness of C;(t) c C,(H(t)) depends on the smoothness of f)(t). When the function H(r) is defined by tn or by a lower degree polynomial function, H(t) is infinitely differentiable with respect to I:

=(&t).(a(t), b(t), c(t)).(a(t), h(t), c(r)), (0, 0, 0)) = (0, d(t) .(a(t), h(t), c(t))) (0, -(u(t), b(t), c(t)))

=t”3 .f(t)‘loEdci+ ltt)’ Ci(t)m ‘))‘t”3 -(a(t), Nt), c(t)))

=(.f(f)‘log(Ci+ ,(t)‘citt)- l)‘(a(fX Nr), c(t))t (O, O, O))

= .f‘(t) cl(t)

where f/(t)=log(Ci+ l(t).Ci(t)~ ‘).(a(t), h(t), c(t)). (The operation is interpreted as scalar multiplication, an inner product, or quaternion multiplication, depending on the

392 Computer-Aided Design Volume 27 Number 5 May 1995

context.) Then, we have

dfi) = l”idci + I(fi). ct’ ‘(ti)) ’ (a(ti), Nti)7 c(ci)) = lOg(qi ’ 4; ‘).(U(ti), b(ti), C(ti)) =O

and

g(ti+l)=1o~Ci+l(ti+1)‘C;1(ti+l)).(4ci+,),b(ti+,),c(ri+,)) =lOg(qi+ 1’4~‘kll)‘(a(~i+lX Nti+ I), c(li+ l))=O

Furthermore, we have

@)=f(t).&)

Q(t) = f’(t). g(t) + f(t). g’(t)

e”(t)=f’(t).s(t)+2f’(t).g’(t)+f(t).g”(t)

~(,)=f”‘(t).g(t)+3f”(t).g’(t)+3f’(t).g1’(t)+f(t).g”‘(t)

@k)(@= i k fyt).g”‘@) 0 i=o 2

From the given conditions

AtJco

f(ti+ I)= l

~l)(ti)=...=f(k-l)(ti)=O

fl)(ti+,)=...=f(k-l)(ti+l)=O

and

we can easily show that

e(Li) = P(ti) = . . = P’(ti) = 0

and

Now, we are ready to compute the derivatives (up to order k) of the exponential curve

exp(O, e(r). (4th b(t), C(t))) = 60s e(t), sin e(t) .(a(& HO, c(t)))

That is, we have

s exp(O, W(40y HO, c(t)))

= ( - g(t). sin 8(t), P(t) . cos e(t). (a(t), b(t), c(f)) + sin e(t). (a’(t), b’(t), c’(t)))

= @It). ( - sin 8(t), ~0s e(t) . (4th W, c(O)) + sin e(t).(O, (a’(f), b’(t), c’(t)))

By substituting t = ti into the expression, we get

% = expW). (40, b(t), c(t))) = 0 t fr

Similarly, we can easily show that each term of the jth derivative of the exponential curve has a scalar factor of @(t), . . . . e)(t), or sin e(t), for j= 1, . . ., k. Thus the jth derivative at time t =ti vanishes; that is,

$ = exMW(4~)~ WY c(O))=0 j= 1, . . ., k f 1,

Now, we differentiate the whole expression forQ,(t):

Q:(t) = z evW) . (40, b(t), c(t))). GO)

+ wC?O~ (4th b(t), c(t))) . CXd

In general, we have

j= 1, . . ., k

Thus, at time t = t, we have

Qy’(tJ = exp(O) . Cy(ti) = Cf’(ti) j= 1, . . ., k

For the proof of Q:(ti+ 1) = Ci+ ,(ti+ J, we need to differentiate the second expression of Q,(t) given in the above definition:

QXt)=exp((l-f(t)).l~g(CXt).Ci+,(t)-~)).C~+~(t)

In a way similar to that above, we have

d j

dt’ f=r,+, exp((1 -f(t)) .lOg(Ci(t). Ci+ i(t)- ‘)) =O

and

Q%“(ti+1)=C?I~(ti+1) j=l,...,k

Finally, from the following two conditions:

Q$“(“) = C$‘l(tJ= Qp? &)

and

Q~‘(“(ti+1)=C~~l(ti+1)=Q~~,(ti+1) l<j<k

we have shown that Q&) is Ck-continuous with adjacent circular blending quaternion curves Qi_ 1 at ti and Qi+ 1 at ti+ I3 respectively.

Remark: Kim and ShinZo informed the authors that the formula

-$ exp(oc(t)) = exp(oz(t)) . a’(t)

is not true in general for a quaternion curve C(t)=exp@(t)) in SO(3) from the fact that

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

Computer-Aided Design Volume 27 Number 5 May 1995 393

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

Table I Time complexity for circular quaternion curve

Addition Subtraction Multiplication Division Sin COS Arccin Arccos Sqrt

steps l-5 73 84 I97 20 2 2 8

Step 6 9m I 2m ,,, m VI

Total 9m+73 x4 I h - IO7 l?i t 20 ,?I 111 2 2 8

in = x 14s 84 293 7X X X 2 2 8 111 = I 6 217 X4 3X9 36 16 I6 2 2 X n1=32 361 x4 5X1 5’ 32 32 2 2 x m=64 649 84 965 x3 64 04 2 2 x

Table 2 Time complexity for circular blendmg quaternion curve

Addition Subtraction Multiplication Division Sin COS Arcsin Arccos Sqrt

Steps l-5 73 84 197 20 2 2 8 Step 6 x 2 I Xlll ‘4m 201 2m 2m _

Slerps 8m 2rn 14m 2Vl 3m Wi

Total 26m + 73 2rn + x4 3xmt 197 4m + 20 5m 2m 2 m+2 8

11, = 8 781 I 00 501 52 40 16 2 10 8 ,,I = I6 489 II6 805 x4 80 32 2 18 8 ,n = 32 905 148 1413 14X 160 64 2 34 8 ,,I = 64 1737 212 2629 776 320 128 2 66 8

since the quaternions are not commutative in general (see Reference 23). The misunderstanding was originated from an equivalent formula

dq” = q” In(q) dcc + LYE” ’ dq

which Shoemake” cited (but erroneously missing the cornplanarity condition q. dq = dq . q) from the great work of Hamilton”, pp 148 and 453. The authors stated in Reference 22 that the proof of

and

is straightforward from the above formula of Shoemake”: thus the proof is incorrect. A correct proof has been given in this section (not only for C’ continuity, but also for Ck continuity).

COMPARISONS WITH OTHER METHODS

Pseudocode is given in Appendix B for the algorithm to generate a circular quaternion curve in S3. There are six steps in the algorithm. The details of each step have been explained in the second section. In an implementation of the algorithm, various computational shortcuts have been carried out for efficiency. Table 1 shows a measure for the computation time of the implemented algorithm; the time complexity is given in terms of the number of arithmetic operations and mathematical function calls required for the generation of a single circular quaternion curve approximated with m unit quaternions. Table 2 shows a similar measure for the generation of a circular blending quaternion curve which blends two circular

Table 3 Computational resulta

Methods and time. /ls

Bkzier Squad Circular Cardinal

SGI C‘rimson Elan X 7 300 4 300 3 700 2 600 16 I3 100 7 800 6 400 5 700 32 24 700 14800 I I 700 I I 300 64 47 000 38 600 22400 20 000

SGI Indigo XS24 x I4 700 9 000 7 300 4 300 I6 26 600 I6300 12400 9 300 12 50400 30 800 23 200 18800 63 97 600 59 500 44 400 34 200

SGI JD 35TG X 13600 8 200 6 400 3 900 I6 24 300 14700 II 100 x 400 31 45 800 27 700 ‘0 x00 17 100 64 XX 900 53 700 40 100 3lOQO

curves (with a linear blending function); each circular curve is approximated with m unit quaternions.

We have implemented four different methods which can interpolate a given sequence of keyframe orientations of a 3D solid: the Btzier method of Shoemake6, the squad method of Shoemakelzl the circular blending method of this paper, and the cardinal spline method of Pletinckx14. The Catmull-Rom spline method of Schlag’ has a time complexity similar to that of the Btzier method6; the tensioned B-spline method based on the midpoint subdivision’4 has a time complexity similar to that of the cardinal spline method14. The circle methods15.16 definitely perform better than the other methods. Thus it is sufficient to measure the relative computational performances of the four methods for an evaluation of the circular blending method (presented in this paper). Test runs were made for 16 input solid orientations randomly generated. Table 3 shows the computational results of the four methods with four different values of m (8, 16, 32 and 64) on three different machines: an SGI

394 Computer-Aided Design Volume 27 Number 5 May 1995

Crimson/Elan with a 50 MHz R4000 CPU, an SGI Indigo/XS24 with a 33 MHz R3000 CPU, and an SGI 4D/35TG with a 36 MHz R3000 CPU. On the test run for the circular blending method, all but two of the angular functions O(t) were observed as quadratic polynomials; two exceptions were cubic polynomials. The circular blending method has a computational performance in-between those of the squad method and the cardinal spline method.

The circle methods’59’6 and the midpoint subdivision method14 are computationally more efficient than our method; however, they have relative disadvantages:

l The circle methods’5*16 construct a piecewise circular C’-continuous quaternion path which may generate a large angular acceleration/torque at the junction of two circular arcs.

l The number of in-betweens generated by the subdivision methodI is always of the form (2’- l), for some integer i>O, which is a severe restriction for keyframe animation systems in practice.

Each circular arc is a planar curve which is totally contained in a 2D osculating plane in [w4; thus, at each junction of two circular arcs, the two osculating planes meet at a certain angle, and the first osculating plane jumps abruptly into the second plane at the junction. This sudden change of the osculating planes generates a large angular acceleration/torque which may cause undesirable effects for the smooth animation of a moving 3D solid”. Other quaternion curves with only C’ continuity would have a similar discontinuity problem; however, the osculating planes change smoothly in the middle of the curves, and the discontinuity is much smaller at the junction of two curve segments. Thus nonplanar quaternion curves are required for smooth animation. In this paper, to overcome such a drawback of piecewise circular curves, each pair of two circular curves are smoothly blended together on S3 (by a polynomial blending function of degree (2k- 1)) to generate a Ck-continuous quaternion path on S3.

Even with a linear blending function, our method can construct a Cl-continuous quaternion path; furthermore, with a cubic blending function, we can easily construct a C2-continuous quaternion path. Although cubic blending functions are used (in our method) for the construction of a C*-continuous quaternion path, the construction method itself is much simpler and more efficient than that for generating a C2-continuous path (which interpolates a sequence of keyframes) with B-spline quaternion curves . 1 1 One might think a quintic curve would be generated by blending two circular curves by a cubic blending function. However, the question is ‘what is the degree of a quaternion curve in S3?. The circle methods’ ‘,16 have a clear answer to this question since the circles in S3 are constructed as rational quadratic curves in lR4. However, in the other methods based on the construction of slerps, nonpolynomial analytic functions (i.e. exp and log) are used that generate nonalgebraic curves embedded in S3c [w4; thus no algebraic degree is defined for any quaternion curves defined in this way. Moreover, in this paper, each circular curve Ci(t) is parameterized by the analytic functions cos 8 and sin 8; the circular curve is further reparam- eterized by an angular function 0(t) so that it can

interpolate the three keyframe quaternions qi _ 1, qi, qi + 1 at times ti _ 1, ti, ti + i, respectively. Thus the circular curve Ci(t) does not itself have an algebraic degree. An alternative might be to use the rational quadratic curves of References 15 and 16; however, the rational curve does not have a uniform speed even before the reparameteriza- tion. Although the nonuniform speed makes the angular speed control more difficult, the rational curves need further investigations for applications in computer animation since they are the only curves for which algebraic manipulations can be carried out.

In our method, each circular curve Ci(t) is defined by

Ci(t)=Ci(Qt))= T-‘. T-’ .S-’ .[COStl(t) sin O(t)lT+p,

where T-l and T-l are rotations, S-l is a scaling by a factor s (which is the radius of the circle Ci(t)), and p. is a fixed point (see the third subsection of the second section). Thus we have

C;(t) = T- ’ . T- ’ . S- ’ . [-sin 0(t) cos O(t)]T. e'(t)

This means that each velocity Q’(t) of an angular curve e(t) (on the unit circle S’) is mapped into a velocity C:(t) which has the magnitude of s. ll@(t)\l; the speed of 0(t) is thus linearly preserved on the circular curve Ci(t), which makes angular speed control relatively easy.

When we carefully examine the differential calculus for a quaternion curve (such as the one discussed in the second subsection of the third section), we realize that many of the difficulties result from the nonintuitive behaviours of the two functions exp and log. When a quaternion curve is defined by a recursive construction of slerps, the exp and log functions are nested recursively in the formula and the differential calculus for such a formula becomes very difficult to compute. The circular blending method uses only one slerp construction; thus the differential calculus becomes relatively easier than that for other methods which use more than one slerp construction recursively. For example, in the Bezier/ squad method6,12, each curve point is generated by a recursive construction of slerps, in which the recursion is applied three/two times in depth. The simplicity and generality of quaternion curve construction and the associated computational complexity mainly depend on the number of recursive applications of the slerp construction, and not much on the degree of the blending function used. This justifies our use of high degree polynomial blending functions.

The midpoint subdivision method of Pletinckx14 uses j-step recursions to generate 2’- ’ midpoints at each jth intermediate step, for j= 1, . . ., i. The quaternion curve is generated as a sequence of (2’- 1) discrete unit quaternion points. Although the method of Pletinckx14 is both simple and efficient, it is very difficult to compute any differential properties of the curve. As the number i increases, the recursive steps increase indefinitely; the curve derivatives (even at the curve endpoints) become extremely difficult to compute. Thus no Hermite quaternion curve can be constructed using the midpoint subdivision method14. Using the simple structures of circular reparameterization and circular blending, the circular blending method of this paper can be easily extended to generate a Hermite interpolation quaternion curve”. The Btzier and squad methods6.12 can also be

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

Computer-Aided Design Volume 27 Number 5 May 1995 395

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

extended to generate Hermite quaternion curves; however, the correctness proofs are slightly more difficult than that in Reference 18.

CONCLUSIONS

We have described an efficient algorithm to construct a circular quaternion curve which interpolates a given triple (qi _ 1, qi, qi + 1) of solid orientations. Using a method similar to the parabolic blending of 0verhauser4, we construct a quaternion curve Qi which interpolates the two solid orientations qi and qi+ 1 while smoothly blending the two circular quaternion curves Ci and Ci + 1. By connecting the quaternion curve segments Qi in a connected sequence, we construct a Ck-continuous quaternion path on SO(3) which smoothly interpolates a given sequence of solid orientations.

The circular blending method (presented in this paper) has relative advantages over each of the previous methods for constructing quaternion curves in S3:

It is simple and computationally efficient. No large angular acceleration/torque is generated at the junction of two curve segments. It can generate an arbitrary number of in-betweens. The path can interpolate a given sequence of keyframes. The generated quaternion path is Ck-continuous. Only one slerp construction is used for the construction of a circular blending quaternion curve Qi(t); this greatly simplifies the computation of differential properties of a circular blending curve. The speed of an angular function e(t) is linearly preserved on the circular curve Ci(t) (i.e. iiC:(t)ll = s. ll@(t)l/); thus the rotational speed is easy to control on a circular quaternion curve. This greatly simplifies the construction of a Hermite interpolation curve on S3 and SO(3) (see Reference 18).

ACKNOWLEDGEMENTS

The authors are grateful to Myoung-Jun Kim and Professor Sung Yong Shin, KAIST, Korea, who corrected the authors’ misunderstanding of the formula

9 exp(a(t))’ = exp(cc(t)) . x’(r)

(See also Reference 23 and the remark at the end of the third section.) The authors would also like to thank an anonymous referee of the paper who provided many valuable technical comments and useful suggestions which greatly improved the presentation of the paper. Professor Sung-Je Hong and Professor Chan MO Park, POSTECH, Korea, served as program committee members for the second author’s MS thesis, and provided many useful comments on the manuscript of the thesis which included this paper in part. The research described in this paper was supported in part by RIST and KOSEF. A preliminary version of this paper first appeared in Reference 22.

REFERENCES

5

6

I

8

9

IO

II

16

17

IX

IY

20 21

27

23

Thalmann, N M and Thalmann, D Computer Animation: Theor,~ and Pracrice (2nd Ed.) Springer-Verlag. Japan (1990) Donald, B ‘A search algorithm for motion planning with six degrees of freedom’ ArtiJ Intel/. Vol3 1 No 3 (1987) pp 295-353 Curtis M, Matrix Groups Springer-Verlag. USA (1979) Overhauser, A ‘Analytic definition of curves and surfaces by parabolic blending’ Technical Reporr X68-40 Ford Motor Company Scientific Laboratory (8 May 1968) Catmull, E and Rom, R ‘A class of local interpolating splines’ in Barnhill, R E and Riesenfeld, R F (Eds.) Computer Aided Geome/ric Design Academic Press, USA (1974) pp 3 17-326 Shoemake, K ‘Animating rotation with quaternion curves’ Compu,. Graph. Vol 19 No 3 (1985) pp 245-254 (Proc. Siggraph 85) Farin, G Curves and Surfaces for Compuler Aided Geometric Design: A Pructical Guide (2nd Ed.) Academic Press, USA (1990) Schlag, J ‘Using geometric constructions to interpolate orientation with quaternions’ in Arvo, J (Ed.) Graphics Gems II Academic Press, USA (1991) pp 377-380 Barry, P and Goldman, R ‘A recursive evaluation algorithm for a class of CatmulllRom splines’ Compur. Graph. Vol 22 No 4 (I 988) pp 199-204 (Proc. Siggruph ‘88) Duff. T ‘Splines in animation and modeling’ Sturr of the Art m Imugr S~nfhesis (1986) (ACM Siggraph ‘86 Course Notes 15) Nielson, G and Heiland, R ‘Animated rotations using quaternions and splines on a 4D sphere’ Programmirouanie No 4 (Jul-Aug 1992) pp 17-27 (English edition: Programming and Computer Safi~~,are Plenum, USA) Shoemake, K ‘Quaternion calculus for animation’ Math for SIGGRAPH (1991) (ACM Siggraph ‘91 Course Notes 2) Boehm, W ‘On cubits: a survey’ Comput. Vision, Graph. & Image Proi,. Vol 19 (1982) pp 201-226 Pletinckx. D ‘Quaternion calculus as a basic tool in computer graphics’ Visual Comput. Vol 5 No 1 (1989) pp 2-13 Nielson, F ‘Smooth interpolation of orientations’ Proc. Conzpufer .4nimulion ‘93: Models and Techniques in Computer Animation Springer-Verlag (1993) pp 75-93 Wang, W and Joe, B ‘Orientation interpolation in quaternion space using spherical biarcs’ Proc. Graphics Interface ‘93 (1993) pp 2432 Barr. A, Currin, B, Gabriel, S and Hughes, J ‘Smooth interpolation of orientations with angular velocity constraints using quatemions’ Comput. Graph. Vol 26 No 2 (1992) pp 313-320 (Proc. Siggraph ‘92) Kim. M-S and Nam. K-W ‘Hermite interpolation of solid orientations with circular blending quaternion curves’ Proc. CC Inrernarional ‘94 Morrison, J ‘Quaternion interpolation with extra spins’ in Kirk, D (Ed.) Granhics Gems III Academic Press. USA (1992) DD 96.97 Kim, M-J and Shin, S Y (Jan 1994) (private communication) Hamilton, W Elements af Quuternions - Vol I(3rd Ed.) Chelsea, USA (1969) Kim, M-S and Nam, K-W ‘Interpolating solid orientations with circular blending quaternion curves’ Proc. CC Infernational ‘93. Communicating vi/h Virrual Worlds Springer-Verlag, Japan (1993) pp 258-269

Kim, M-J, Kim, M-S and Shin, S Y ‘A compact differential formula for the derivative of a unit quaternion curve’ Int. I. Ci’sualizalion & Comput. Animation

APPENDIX A

Calculus for unit quaternions

Given two 4D vectors qi = (wi, xi, yi, zi) E iw4, for i = 1, 2, we may interpret qi as qi=(wi, (xi, yi, Zi))E Iw x iw3. The quaternion multiplication q1 ‘q2 =(w,,, xlz, y,,, z,~)-

(w,z, (x11 J’lZ> z~~))E [w x R3 = 5X4 is defined as follows:

\1 ,z=lt’, ~wz-(.~,, 4’1, z1).@2, 1’2, 22)

(-~,z, .1‘12> z12)=u’2.(x1, 4’1, i,)fw,.(x,, y2, z2)

+(.x,3 Yl, Zl) x (x2, Y2, z2)

396 Computer-Aided Design Volume 27 Number 5 May 1995

The above quaternion multiplication is closed on unit quaternions: for any ql, q2ES3, we have q1 .qz~S3. Moreover, (LO, 0,O) =( 1, (0, 0,O)) E S3 is the multiplicative identity, and the inverse of qi is given by qCF1 = (wi, -xi, -yi, -zi)=(wi, -(xiv yiy zi))=qiES3, where qi denotes the conjugate of qi. Note that the relation ql.q2 = Q2. q1 holds for quaternion multiplication. Each unit quaternion qi can be understood as a rotation which maps each 3D vector (x, y, Z)E R3 into a 3D vector (x’, y’, z’) E R3 given by

(03 X’, Y’, z’) = qi ’ (02 X2 Y, z, ’ 4i

Since qi and - qi give the same rotation, qi and - qi are identified as an identical element of SO(3). Each unit quaternion qi can also be understood as an orientation of a 3D solid which is obtained by applying the rotation qi to the solid in the standard orientation.

Given two solid orientations q1 and q2, the unit quaternion q2. q; 1 g ives a rotation or relative orientation change which transforms the orientation q1 into a new orientation q2. That is, for any 3D vector (x, y, z) E lR3, we have

(q2.q;1).(41~(o, x, Y, 4.41M2??;1) =((q2.q;1).41).(o? x2 YY 4.Kq2.q;‘)~ql) =q2 .(O, x, Y, 4.42

which means that the composite rotation of q1 followed by qz.q;l is the same as the single rotation q2. The order of multiplication is important since the quaternion multiplication is not commutative. Let

q2.q;l= (w, x, Y, 4 E s3

0 = arctan (x2+yz+22)1’2

W >

and

(a, b, 4= (TY?Z) Es2

(x2+y2+z2p2

then the rotation q2. q; ’ =(cos 8, sin 0.(a, b, c)) can be understood as the rotation about the axis (a, b, c) by an angle 28. As the angle is changed from 0 to 20 with a constant angular speed, each intermediate solid orientation obtained is the same as that obtained by rotating the solid about the axis (a, b, c) by an angle 2Ot, 0~ t d 1, and the corresponding quaternion representation of the rotation is given by

r(t) = (cos dt, sin Ht. (a, b, c)) E S3 O<t<l

Note that

y(O)=(l, O.(a, b, c))=(l, 0, 0, 0)~s~

y(l)=(cos 0, sin 0.(a, b, c))=qz.q;lES3

y’(t) = ( - 0 sin tit, 8 cos 8t. (a, b, c)) E R4

y’(O) = (0, 6. (a, 6, c)) E R4

and

IlWll = IIQII

The path y(t)=cos h-(1, 0, 0, O)+sinBt.(O, a, b, c), 0 < t d 1, is on a great circle which is the intersection of S3 with a 2D plane spanned by the two unit vectors y(O) = (1, 0, 0, 0) E S3 and y(l/@=(O, a, b, C)E S3; furthermore, the path y(t) has a constant speed 1) 8)). Thus y(t), 0 < t < 1, is a geodesic arc between the two unit quaternions 1 and q2.41l.

For any velocity (0, @a, b, c) E {0} x R3 = R3 with (a, b, c)ES~, we have

(0, e.(a, b, c))‘=(-e2, 0, 0, O)=(-0)‘.(1, 0, 0, 0)

The exponential of the velocity (0,0.(a, b, c)) is given by

exp(0, Q. (a, b, 4 = nTo $. (0, 0. (a, b, 4

=.zo &-(o, 0.b k ~9)~”

.(O, 0.(a, b, c))~“‘I

=.zO j+W(l, 0, 0, 0)

+n&iijI .( -e2)“,(0, t?,(a, b, c))

= (

z0 %.82”, 0, 0,o)

+ 0, c (- *) P.02n+1 .(a, b, n=O (2n+ l)!

c) >

= (cos 0, 0, 0, 0) + (0, sin 0. (a, b, c))

=(cos 8, sin f3.(a, b, c))

Thus we have

exp(O, to. (a, b, c)) = (cos Bt, sin Bt . (a, b, c)) O<t<l

Therefore, the logarithm for a unit quaternion (cos 8, sin 9. (a, b, c)) E S3 is given by

log(cos 0, sin 8 .(a, b, c)) = log exp(O, 8. (a, b, c)) = (0, 0. (a, b, 4)

The geodesic path y(t) E S3, for 0 <t d 1, between two unit quaternions (1, 0, 0, 0) and q2 q; ’ = (cos 0, sin 8. (a, b, c)) can be represented by

y(t)=(cos tit, sin 8t .(a, b, c)) =exp(O, tQ.(a, b, c)) = exp(t . log(cos 8, sin 0. (a, b, c))) =exp(t.log(q, .q; ‘))

By multiplying the unit quaternion y(t) with a fixed unit quaternion ql, 0 < t < 1, we can construct a geodesic path

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

Computer-Aided Design Volume 27 Number 5 May 1995 397

Interpolating solid orientations with circular blending quaternion curves: M-S Kim and K-W Nam

Y~,,J~), O,<t< 1, between the two unit quaternions q, and

42:

~~,.&)=~(t).q~ =exp(t.log(q,.q,‘)).q, O<r<l

Given two circular curves C,(t), C2(t)gS3, O<t,< 1, the circular blending quaternion curve Q(t) E S3, 0 d f d 1, which subdivides the geodesic curve segment yr (between the two points C,(t) and C,(t)) in the ratio of t:l -t is given by

Q(t)=exp(t.log(C,(t). C,(t)-‘)). C,(t) =exp((l -t)~log(C,(t)~C,(t)~‘))~C,(t) O<t<l

geomrrric modelling.

Myurzg-Soo Kim i.v un u.s.voc~iutc pro/e.ww in the Department of Computer Sc~irnce. POSTECH, Korw. He rewwd (1 BS und UII MS in mr~thrmatrc.v from Swul Nalional Uniwrsir~, Korea. in 1980 cmd 1982. He contimred hi., gruduuir 5 cudir.c at Purdue C’nrrtwii!~. C!SA whrw hc received an MS in applied mu~hrwu~ic~ s in 1985, und un MS and u PhD it7 con7purer .scirnce it7 1987 cmd l98K. Hi,\ reseurch ir7teresi.c we ~7 c otl7purer graphics. compute7 unir?7uio77, rrnd

Kee- Wor7 Nom receiwd u BS c7nd a77 MS it7 computer .vcref7w jronr POSTECH, Korru, it1 1992 u17d 1994. He i.r cwret7!!). (7 PI7 D studer77 iI7 tl7e Departn7et7t of’ Con7puter Sciet7cr. POSTECH. His reseurc~l7 it7terest.v include computer graphics nnd c’ompurer af7in707iof7.

APPENDIX B

Pseudocode for circular quaternion curve

Algorithm CircularCurve (pr, p2, p3, m,, m2):

begin

(1) Initial setup.

n, c compute the normal p1 x p2 x p3; n4 t normalize n,; nz t compute the normal p, x p3 x n,; n2 t normalize n,; n3 t compute the normal pr x n4 x n,;

(2) Project p,, pZ, p3 into the 2-sphere S2.

T- ’ t the matrix [p,, n2, n3, n,]; T e the transpose of T- ‘; PI +(I, 0, 0); 1)2+- 7-e~~;

~3 + T-P,;

(3) Determine the circle which contains p,, pz, and

P3.

lij+(P2-(1, 0, O))x(p,-(1, 0, 0));

123 t normalize n3: p,, t the centre of the circle; II 1 t normalize E- pO: &tn, x n,;

(4) p,,+T-l-p,; r, + T-‘-n,; o2 + T- ’ - n,;

(5) (I, c the angle between n, and n,; u2 t the angle between n2 and n,;

(6) Generate points on the circular curve.

output( pl); for i:=l to m, +m, do

begin; N t GetNextAngle(i, u,, u2, m,, m2)); p + p0 + us(u)* e, + sin(u) ‘e,; output(p); end;

end

398 Computer-Aided Design Volume 27 Number 5 May 1995