Graphics Programs Reference
In-Depth Information
The last column of T is not (0 , 0 , 0 , 1) T because it is used for projections. (See the
discussion of n -point perspective on page 110.) As a result, the product PT is the
4-tuple ( X, Y, Z, H ), where H equals xp + yq + zr + s and is generally not 1. The
three coordinates ( x ,y ,z )of P are obtained by dividing ( X, Y, Z )by H . Hence,
( x ,y ,z )=( X/H, Y/H, Z/H ).
The top left 3
3partof T is responsible for scaling and reflection ( a , e ,and j ),
shearing ( b, c, f and d, h, i ), and rotation (all nine elements). The three quantities l , m ,
and n are responsible for translation, and the only new parameters are those in the last
column ( p, q, r, s ).
To understand the meaning of s ,weexaminethematrix T = 1
×
.Mul-
1
1
S
tiplying P by T transforms ( x, y, z, 1) into ( x, y, z, s ), so the new point has coordinates
( x/s, y/s, z/s ). The parameter s is therefore responsible for global scaling (by a factor
of 1 /s ). Its effect is identical to transforming by 1 / s
.
1 / s
1 / s 1
Translation in three dimensions is a direct extension of the two-dimensional case.
Apointcanbetranslatedinthedirectionofanyofthecoordinateaxes.
Scaling in three dimensions is simple. An object can be scaled about the origin
along any of the three coordinate axes. To scale about another point P 0 , a sequence
of three transformations is needed. The point should be translated to the origin, the
scaling performed, and the point translated back. Notice that scaling an object is done
by scaling all its points. Scaling a point does not change its dimensions (since a point
has no dimensions) but simply moves it to another location.
Shearing in three dimensions is di cult to visualize. It is controlled by the six
off-diagonal matrix elements b , c , f , d , h ,and i , which is why many variations are
possible. Perhaps the best way to become familiar with three-dimensional shearing is
to experiment with the effect of varying each of the six parameters. Figure 1.19 shows
a few possible shearings of a rectangular box.
Figure 1.19: Shearing in Three Dimensions.
Shearing: A transformation in which all points along a given line L remain fixed while
other points are shifted parallel to L by a distance proportional to their perpendicular
distance from L. Shearing a plane figure does not change its area. This can also be
generalized to three dimensions, where planes are translated instead of lines.
—Eric W. Weisstein, http://mathworld.wolfram.com/Shear.html
Search WWH ::




Custom Search