Graphics Reference
In-Depth Information
2. Scaling. Scales the results of the above translation, where the center of
scaling is now located at the origin.
3. Translation. Translates the results of the scaling operation back to the
original location. In our example with the translation,
t xi =
t x =
5
,
displacement
=
t yi =
t y =
1
,
the origin is translated back to the lower-left corner of the original input
rectangle R i .
In this way, the above three operations strategically selected the reference position
(
) on the input rectangle for scaling. In general, the reference position for
the scaling operation is defined by the displacements
(
5
,
1
)
of the first and last
translation operations. We refer to this reference position for scaling operation as
the pivot position for scaling. We define the operator S pt (
(
t x ,
t y )
s x ,
s y )
:
(
,
)=
(
.
,−
.
)
(
,
)
(
.
,
.
) ,
S pt
s x
s y
T
pt
x
pt
y
S
s x
s y
T
pt
x
pt
y
(9.4)
where
= pt
y
pt
.
xpt
.
is the pivot position. Notice that the simple scale operator S
(
s x ,
s y )
introduced in
Section 8.2 is simply
S
(
s x ,
s y )=
S pt 0 (
s x ,
s y ) ,
where
pt 0
.
x
=
0
,
R i
pt 0
=
origin
=
.
In general, for any enclosed area, if the pivot position is outside of the area, the
scaling operation will have the side effect of moving the entire area. For example,
in Figure 8.8, the pivot position was the origin (and outside of the rectangle area),
and we have seen that the scaling operation caused counterintuitive moving of the
entire output rectangle.
pt 0
.
y
=
0
R o
T(-2,-6.5)
T(2,6.5)
R ts
R t
Figure 9.7 shows applying the pivoted scaling operator S pt (
3
,
0
.
5
)
to the ver-
Figure 9.7. Scaling with
pivot at the center of R i .
tices of R i in Figure 9.5. In this case, we chose the pivot position to be
= 26
5 ,
pt
.
or the center of R i . This is another example of a more intuitive scaling of a rect-
angular area. It is left as an exercise for the reader to verify the vertex positions
of R t , R s , and eventually R o of Figure 9.7.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search