Graphics Programs Reference
In-Depth Information
We can gain a deeper understanding of homogeneous coordinates when we add two
more parameters to matrix (1.7), writing it as
abp
cdq
mn 1
.
(1.8)
A general point ( x, y ) is now transformed to
abp
cdq
mn 1
=( ax + cy + m, bx + dy + n, px + qy +1) .
( x, y, 1)
Applying rule 2 shows that the transformed point ( x ,y )isgivenby
x = ax + cy + m
= bx + dy + n
px + qy +1 ,
px + qy +1 .
To understand what this means, we apply this result to the four points (2 , 1), (6 , 1),
(2 , 5), and (6 , 5) that constitute the four corners of a square (Figure 1.5a). Using the
simple transformation
101
011
001
(i.e., no scaling, rotation, shearing, or translation and p = q = 1), the points are
transformed to
P 1 =(2 , 1)
(2 , 1 , 4)
(1 / 2 , 1 / 4) ,
P 2 =(6 , 1)
(6 , 1 , 8)
(3 / 4 , 1 / 8) ,
P 3 =(2 , 5)
(2 , 5 , 8)
(1 / 4 , 5 / 8) ,
(1 / 2 , 5 / 12) .
The transformed points (Figure 1.5b) also seem to form a square, but one that's viewed
from a different direction and seen in perspective. This suggests that our transformation
(using just p and q , without scaling, reflection, rotation, or shearing) has moved the
square from its original position in the xy plane to another plane. Such transformations
are called projections and are useful when dealing with objects in three-dimensional
space.
1.2.2 Combining Transformations
Matrix notation is useful when working with transformations since it makes it easy to
combine transformations. To combine transformations A , B ,and C , we write the three
transformation matrices and multiply them. An example is an x -reflection, followed by
a y -scaling, followed by a 45 rotation
P 4 =(6 , 5)
(6 , 5 , 12)
10
02
0 . 707
=
.
10
01
0 . 707
0 . 707
0 . 707
0 . 707
0 . 707
1 . 414
1 . 414
Search WWH ::




Custom Search