Graphics Reference
In-Depth Information
Figure 8.9 shows an example of what we may expect, intuitively, from a scal-
ing operation with scaling factors of
Original
Rectangle
(
3
,
0
.
5
)
. In this case, the 2
×
3 rectangle is
scaled with respect to a
reference
position at the lower-left corner of the rectangle
at
R
o
, resulting in the rectangle (
R
o
). We will describe how to accomplish this
kind of transformation in the next chapter after we have a good understanding of
the basic transformation operators.
(
1
,
5
)
Reference=(1,5)
Figure 8.9.
Example of
an “intuitive” scaling oper-
ation.
Negative Scaling Factors: Reflections
Applying a scaling operator with negative scaling factor has the effect of reflecting
the input points across axes. For example, if we apply a scale operator with
s
x
=
−
1and
s
y
=
1(or
S
(
−
1
,
1
)
) on the point
V
a
=(
3
,
4
)
,weget
V
as
=
x
as
y
as
=
V
a
S
(
s
x
,
s
y
)
=
x
a
×
s
y
s
x
y
a
×
=
3
1
×−
14
×
=
−
34
.
Y-axis
S(-1,1)
This result is illustrated in Figure 8.10. We see that with an
s
x
of
1, the input
point
V
a
is reflected across the
y
-axis and not the
x
-axis. Reflection is a special
case of the scaling operator, and we have learned that the scaling operator can be
applied to multiple points. Figure 8.11 shows the results of reflecting four vertices
of a rectangle:
−
V
as
(-3,4
)
V
a
(3,4)
X-ax
is
Origin
⎧
⎨
Figure 8.10.
Effect of
negative scaling factor.
=(
,
)
,
V
a
3
4
V
b
=(
1
,
4
)
,
Input points:
⎩
=(
,
)
,
V
c
1
1
V
d
=(
3
,
1
)
.
We have already seen that scaling by
S
(
−
1
,
1
)
simply flipped the
x
-coordinate
value of
V
a
to
V
as
=(
−
. In this example, we see that the flipping applies to
the rest of the vertex positions:
3
,
4
)
⎧
⎨
V
as
=
−
3
,
4
)
,
V
bs
=
−
1
,
4
)
,
Output points:
⎩
V
cs
=
−
1
,
1
)
,
V
ds
=
−
,
)
.
3
1
Search WWH ::
Custom Search