Graphics Reference
In-Depth Information
10.4.3
WC Window Dimension: Zooming
If we double the WC window size of the small view from Tutorial 10.10 such that
WC window center
=(
15
,
25
) ,
W wc =
H wc =
20
,
then the WC window covers a larger region in the WC system.
From Equa-
tion (10.15):
W dc
W dc
2
x dc
=((
x wc
cx wc )
W wc )+
,
(
10
.
15
)
H dc
H dc
2
y dc
=((
y wc
cy wc )
H wc )+
,
we see that as W wc and H wc are the denominators in the scale factors, doubling
these effectively halves the scaling factors. This implies that we should expect
the elements on the DC display to decrease in size. As illustrated in Figure 10.20,
we see that if we increase the WC window size, more elements in the WC are
displayed in the output display area. Correspondingly, each individual element
does indeed appear to be smaller on the output display. We see that increasing the
WC window size results in the zooming-out sensation. For the same reasons, we
can expect a zooming-in effect when we decrease the WC window size.
Transformed
Window
(15,25)
C o n tent
to be drawn
S( 2 / 20 , 2 / 2 0 )
( 2 /
S( /
20
T( -15,-25)
T(T -
20
( 1,1)
W C
W i ndow
20
(0,0)
20
(-1,-1)
Figure 10.20.
Double the WC window size.
Tutorial 10.11. Scaling the WC Window ( W wc ,
H wc )
Tutorial 10.11.
Project Name:
D3D _ Zooming
Library Support:
UWB _ MFC _ Lib1
UWB _ D3D _ Lib10
Goal. Verify zooming effect in relation to the WC window dimensions.
Approach. Extend Tutorial 10.10 and allow user to adjust the width and
height of the small view WC window.
Figure 10.21 is a screenshot of running Tutorial 10.11. This tutorial extends Tuto-
rial 10.10 with two more slider bars at the lower right of the application window.
The two new sliders are connected directly to the width ( W wc ) and height ( H wc )of
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search