Interpolation of orientations
본문 바로가기
ComputerGraphics

Interpolation of orientations

by Midfall 2022. 11. 9.
320x100

3.3 Interpolation of orientations.

The previous section discussed the interpolation of position through space and time. Animators are concerned with the object's orientation. An object's orientation can be interpolated just like its position can be interpolated and the same issues apply. Just as an object's position is changed over time by applying translation transformations, an object's orientation is changed over time by applying rotational transformations.

 

3.3.1 Interpolating quaternions

One of the most important reasons for choosing quaternions to represent orientation is that they can be easily interpolated. The quaternion representation avoids the condition known as gimbal lock.

 

Because the magnitude of quaternion does not affect the orientation it represents, unit quaternions are typically used as the canonical representation.

 

Orientations can be produced by linearly interpolating the individual quantities of the quaternion four-tuples. The interpolation will not produce a constant speed rotation. This is because the unit quaternions to which the intermediate orientations map will not create equally spaced intervals on the unit sphere.

 

Intermediate orientations representing constant-speed rotation can be calculated by interpolating directly on the surface of the unit sphere. In the previous chapter, it was pointed out that a quaternion, [s,v] and its negation [-s,-v] represent the same orientation. This means interpolation from q1 to q2 can be carried out from q1 to -q2. The difference is that one interpolation path will be longer than the other. The shorter path is more desirable because it is more direct way. The shorter path is the one indicated by smaller angle.  This can be determined by using the four-dimensional dot product of quaternions to compute the cosine of the angle between q1 and q2. If the cosine is positive, then path from q1 to q2 is shorter; otherwise the path from q1 to -q2 is shorter.

The formula for slerp between unit quaternion with parameter u varying from 0 to 1 is given. Notice that this does not necessarily produce a unit quaternion, so the result must be normalized.

Notice that in the case u=1/2, slerp can be easily computed with in a scale factor as q1+q2.

 

When interpolating between a series of rotations, slerping on a spherical surface has the problem: that of first-order discontinuity. Shoemake suggests using cubic Bezier interpolation to smooth the interpolation between orientations. Reasonable interior control points are automatically calculated to define cubic segments between each pair of orientations.

 

To introduce this technique,assume that there is a need to interpolate between a sequence of two-dimensional points; these will be referred to as interpolated points. Between each pair of points, two control points will be constructed. To calculate the control point following any particular point p_n take the vector defined by p_n-1 to p_n and add it to the point p_n. Now take this point(1) and find the average of it and p_n+1. This becomes one of the control points.

 

Next take the vector defined by a_n to p_n and add it to p_n to get b_n. Points b_n and da_n are the control points. This construction ensures first-order continuity.

Because the control points on either side of the point are colinear with and equidistant to the control point itself. 

 

The end condition can be handled by a similar construction. The first control point, a_n is constructed as the vector from the third interpolated point to the second point(p1-p2) is added to the second point.

End condition

in forming a control point, the quality of the interpolated cuvre can be affected by adjusting the distance the control point from its associated interpolated point while maintaining its direction from that interpolated point. For example, a new b_n' can be computed with a constant k, as in equation 3.30

A cubic Bezier curve segment is then defined by the points p_n,a_n,b_n+1 and p_n+1. The cubic curve segement is generated between p_n and p_n+1.

 

It should be easy to see how this procedure can be converted into the four-dimensional spherical world of quaternions. Rotations are concatenated using quaternion multiplication. Averaging of orientations can be done by slerping to the halfway orientation. Adding the difference between two orientations can be affected by constructing the representation of the result, r, on the four-dimensional unit sphere using Equation 3.31

Once the internal control points are computed, the "de Casteljau algorithm" can be applied to interpolate points. The same procedure can be used to construct the Bezier curve in four-dimensional spherical space.

The procedure can be made more efficient if the points are generated in order according to binary subdivision and temporary values are saved for use in subsequent calculations.

300x250

'ComputerGraphics' 카테고리의 다른 글

Smoothing a path  (0) 2022.11.11
Working with paths  (0) 2022.11.09
General distance-time functions  (0) 2022.11.08
Ease-in/Ease-out  (0) 2022.11.07
Reference notice for Computer graphics category  (0) 2022.11.04

댓글