Graphics Reference
In-Depth Information
the m _ small _ view 's m _ WCWindow . Based on the previous discussions, we under-
stand that as the user adjust the slider bars, the resulting changes will be reflected
in the subsequent M w 2 n (Equation (10.10)) operator that is loaded into the M V ma-
trix. In this tutorial, we can interactively adjust and observe the expected zooming
effects. In addition, we observe the following.
• Changing W wc without corresponding changes to H wc (or changing H wc
without corresponding changes to W wc ) creates an annoying squeezing ef-
fect. We will examine this closely in the next section.
Figure 10.21.
Running
Tutorial 10.11.
• The zooming effect appears to be defined with respect to the center of the
WC window. That is, as we zooming in, it appears we are getting closer
to the center of the WC window. This is a direct result of our scaling the
width and height of the WC window with respect to the center of the WC
window. It is left as an exercise for the reader to derive implementations to
support zooming with respect to some other position in the WC window.
10.4.4
WC Window Width-to-Height Ratio: Aspect Ratio
Recall that the WC-to-DC transformation is governed by Equation (10.14), the
M w 2 d operator, or
W dc
W wc ,
H dc
H wc )
W dc
2
H dc
2 ) . (
M w 2 d =
T
(
cx wc ,−
cy wc )
S
(
T
(
,
10
.
14
)
We observe that the middle scaling operator controls the zoom factor. When the
scaling factors in the x -and y -directions are different, then the transformation
from WC to DC will involve resizing objects in x -and y -directions by different
amounts. In the cases of Tutorials10.4 and 10.5, we worked in the NDC space
directly with a WC window size of
W wc
=
2 with
1
x
1
,
H wc =
2 with
1
y
1
.
For both tutorials,
H dc .
This means that the factors of the scaling operator in Equation (10.14) are different
in the x -and y -directions. For this reason, in both cases we observed the squashed
circles. In order to maintain proportional shapes from WC to DC, the x and y
scaling factors in the M w 2 d operator must be the same, or
W dc
W wc =
W dc =
H dc
H wc .
 
Search WWH ::




Custom Search