Graphics Reference
In-Depth Information
BOOL CTutorialDlg::OnInitDialog()
.
// m _ view is a DrawOnlyHandler (D3DWindowHandler)
if (!m _ view.Initialize( * this , IDC _ PLACEHOLDER))
return FALSE;
UWB _ BoundingBox wcWindow( vec3 (10, 20), vec3 (20, 30)); // initialize the wcWindow
// set the m _ WCWindow of WindowHandler object
m _ view. SetWCWindow( wcWindow ) ;
.
A:
Source file.
TutorialDlg.cpp file in the
Source Files
void CDrawOnlyHandler::DrawGraphics()
.
BeginDraw();
folder
of
the
D3D _ WCSupport project.
B:
// compute and load the M w 2 n to the VIEW matrix processor
LoadW2NDCXform() ;
. .); // Clears the device for drawing
theApp.GetModel().DrawModel(); // Tells the Model to draw itself
EndDrawAndShow();
.
m _ pD3DDevice->Clear(
Listing 10.10. Working with UWBGL _ D3D _ Lib10 (Tutorial 10.9).
10.4.2
WC Window Position: Panning
Recall that Equation (10.15) defines the transformation of a point from WC space
(
x wc ,
y wc )
to DC space
(
x dc ,
y dc )
:
W dc
W dc
2
=((
)
W wc )+
,
x dc
x wc
cx wc
(
10
.
15
)
H dc
H dc
2
y dc
=((
y wc
cy wc )
H wc )+
,
where W dc ×
H dc is the drawing device dimension and
center
=(
cx wc ,
cy wc ) ,
WC window
=
width
=
W wc
,
.
=
.
height
H wc
In Tutorial 10.8, we observed that by changing the WC center position
(
cx wc
,
cy wc
)
,
we can show different regions of the model defined in the WC system. Based on
our discussions, we can predict that a continuous changing of WC window posi-
tion would create an effect of panning through the WC system.
Search WWH ::




Custom Search