Graphics Reference
In-Depth Information
class
CDrawHandler :
public
UWBD3D
_
WindowHandler
{
public
:
.
Source file.
DrawOnlyHandler.h/cpp
files in the
WindowHandler
folder of the
D3D
_
CameraLib
project.
A:
void
DrawGraphics();
.
protected
:
B:
UWBMFC
_
UIWindow m
_
window;
// The drawing area
};
void
CDrawHandler::DrawGraphics() {
.
BeginDraw();
C:
LoadViewXform();
LoadProjectionXform();
D:
D3DXMATRIX
identity; D3DXMatrixIdentity(&identity);
m
_
pD3DDevice->SetTransform( D3DTS
_
WORLD, &identity);
m
_
pD3DDevice->Clear( ... );
E:
theApp.GetModel().DrawModel();
EndDrawAndShow();
}
Listing 15.9.
The
CDrawHandler
class of Tutorial 15.1.
different classes to support programmability. The resulting matrix is the
view matrix
M
w
2
e
, as defined by Equation (14.4). The final step of com-
puting the view matrix at label A1c involves rotations to support mouse
interactions. We will examine this last step in Tutorial 15.3.
•
Projection matrix (label B).
The
LoadProjectionXform()
function com-
putes the projection matrix
projMat
(at label B1) and loads this matrix into
the
PROJECTION
matrix processor (at label B2). The
projMat
is computed
by the
ComputeProjectionMatrix()
function, where at label B1a we ac-
cess the view frustum parameters from the
UWB
_
Camera
class, and at label
B1b we call the
D3DXMatrixPerspectiveFovRH()
function to compute
the actual perspective projection matrix. Notice that as above, we are call-
ing the exact same function as that label C1 in Listing 14.4. Once again, the
UWBGL library merely reorganizes graphics API function calls to support
abstractions.
Search WWH ::
Custom Search