Graphics Reference
In-Depth Information
From the above discussion, we understand that both the left and bottom edges of
rectangle R t will be kept stationary under scaling. As a result, when we apply
S
(
3
,
0
.
5
)
on the vertices of rectangle, we get rectangle R ts :
V at s =(
6
,
1
.
5
) ,
R i
V bt s =(
0
,
1
.
5
) ,
R o
Output from scaling :
V ct s =(
0
,
0
) ,
T(-1,- 5)
V dts =(
6
,
0
) .
T(1,5)
When comparing to R t , R ts is the result of stretching the right edge by three times
and the compressing the top edge by half the original height. Notice that there is
no counterintuitive movement when scaling R t into R ts . Figure 9.6 shows that by
R t
R ts
applying the inverse of the original translation operator
Figure 9.6. Achieving
the effect of Figure 8.9.
T 1
(
1
,−
5
)=
T
( (
1
) ,− (
5
)) =
T
(
1
,
5
)
to the vertices of rectangle R ts ,weget:
V ao
=(
7
,
6
.
5
) ,
V bo =(
,
.
) ,
5
6
5
Vertices of R o :
V co =(
5
,
5
) ,
V do =(
7
,
5
) .
Transforming from rectangle R i to R o , we have accomplished the effects of Fig-
ure 8.9.
9.3.1
Scaling with Arbitrary Pivot
In the above example, we applied a series of three operators,
T 1
T
(
1
,−
5
)
S
(
3
,
0
.
5
)
(
1
,−
5
) ,
to the input vertices of the original rectangle R i . Notice that the last operator
( T 1 ) is the inverse transform of the first translation operator ( T ). In practice, the
above three operators are used in the following way.
Order of operation. Remem-
ber that the leftmost operator is
the one that operates on input
vertices first . In the case of
TST 1
1. Translation. Translates all vertices such that the center of scaling becomes
the origin. In the above example, the scaling operation was defined with
respect to the lower-left corner of rectangle R i , and thus the translation is
,
t x =
T will be the first to be applied
on the input.
5
,
displacement
=
t y =
1
.
This operation translates the lower-left corner to the origin.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search