Graphics Reference
In-Depth Information
(15,25)
Transformed
Window
NDC to DC
(by D3D)
S( 2 / 10 , 2 / 10 )
10
S(S 2
T( -15,-25)
T(-
10
(1,1)
WC
W in dow
2
10
NDC
(Internal
To D3D)
(-1,-1)
2
10
(0,0)
Figure 10.14.
Location of WC window as defined by Equations (10.8) and (10.9).
Notice that there are no physical boundaries around the WC window. As pro-
grammers, we choose the WC window and program the M w 2 n operator accord-
ingly. For example, in Tutorial 10.7, we could easily choose to select a different
WC window:
WC window center
Tutorial 10.8.
Project Name:
D3D _ TranslateWC
Library Support:
UWB _ MFC _ Lib1
UWB _ D3D _ Lib9
=(
15
,
25
) ,
(10.8)
width
=
height
=
10
,
and define the M w 2 n to be
S 2
2
10
M w 2 n =
T
(
15
,−
25
)
10 ,
.
(10.9)
Tutorial 10.8. Translating the WC Window ( Figure 10.14 )
Goal. Verify our understanding that we can move the WC window in the
WC system to show a different part of the WC system.
Approach. Program Equation (10.9) to verify our understanding.
Figure 10.15.
Running
Tutorial 10.8.
Figure 10.15 is a screenshot of running Tutorial 10.8. The implementation of
this tutorial is identical to that of Tutorial 10.7, except we program the M w 2 n
according Equation (10.9) as shown in Listing 10.5. The image output of the
the program does reflect our predictions from Figure 10.14. In this case, we can
see the greyish outline of the rest of the geometric person of Figure 10.10. If we
Clipping. Graphics APIs only
process and display geome-
tries inside the ± 1 range of the
NDC space. Geometries out-
side of this range are clipped
and/or otherwise guaranteed
to not show up in the UI draw-
ing area.
examine the class definition in Listing 10.6, at label A we observe that the CModel
class defines the geometries for the entire human of Figure 10.10 in the m _ figure
PrimitiveList object. At label B, we see that the CModel::Draw() function
draws all the geometries that are defined in the m _ figure object. However, from
the output of this tutorial in Figure 10.15, we see that only the geometries inside
the WC window are displayed in the UI drawing area. From this tutorial, we see
that the graphics API clips away all the geometries outside of the NDC
±
1 range.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
Search WWH ::




Custom Search