Graphics Reference
In-Depth Information
The second approach is, for each frame, to incrementally modify the transformation matrix that
takes the object space points into the world space positions. In the example of the moon, the transfor-
mation matrix is initialized with the x -axis translation matrix. For each frame, a delta z -axis transfor-
mation matrix multiplies the current transformation matrix and then that resultant matrix is applied to
the moon's object space points (see Figure 2.12 ) . Round-off error will accumulate in the transformation
matrix. Over time, the matrix will deviate from representing a rigid transformation. Shearing effects
will begin to creep into the transformation and angles will cease to be preserved. While a square may
begin to look like something other than a square, coplanarity will be preserved (because any matrix
multiplication is, by definition, a linear transformation that preserves planarity), so that rendering
results will not be compromised.
The third approach is to add the delta value to an accumulating angle variable and then build the
z -axis rotation matrix from that angle parameter. This would then be multiplied with the x -axis trans-
lation matrix, and the resultant matrix would be applied to the original moon points in object space
(see Figure 2.13 ) . In this case, any round-off error will accumulate in the angle variable so that, over
time, it may begin to deviate from what is desired. This may have unwanted effects when one tries
to coordinate motions, but the transformation matrix, which is built anew every frame, will not
accumulate any errors itself. The transformation will always represent a valid rigid transformation with
both planarity and angles being preserved.
Orthonormalization
The rows of a matrix that represent a rigid transformation are perpendicular to each other and are of unit
length (orthonormal). The same can be said of the matrix columns. If values in a rigid transformation
matrix have accumulated errors, then the rows cease to be orthonormal and the matrix ceases to
represent a rigid transformation; it will have the effect of introducing shear into the transformation.
However, if it is known that the matrix is supposed to represent a rigid transformation, it can be
massaged back into a rigid transformation matrix.
A rigid transformation matrix has an upper 3
3 submatrix with specific properties: the rows (col-
umns) are unit vectors orthogonal to each other. A simple procedure to reformulate the transformation
y
R = identity matrix
R dz = z-axis rotation of 5 degrees
repeat until (done) {
for each point P of the moon {
P
3
2
= R*P
}
record a frame of the animation
R = R*R dz
}
x
( r , 0, 0)
z
FIGURE 2.12
Rotation by incrementally updating the rotation matrix.
 
Search WWH ::




Custom Search