Graphics Reference
In-Depth Information
class CDrawHandler : public UWBD3D _ WindowHandler {
// code similar to Listing 15.1 are not shown here
To remind ourselves:
// the following are defined in the super classes:
// UWB _ WindowHandler and UWBD3D _ WindowHandler
Source file.
Pseudocode; no correspond-
ing source file.
// The camera of the drawing area
UWB _ Camera
m _ Camera;
C:
// Computes and loads: M w 2 e to M V
D:
LoadViewXform();
// Computes and Loads: M e 2 n to M P
LoadProjectionXform();
// Transform points from DC to WC (in 3D)
DeviceToWorld(...);
}
CDrawHandler::DrawGraphics() {
.
// initialize I 4
E:
D3DXMATRIX identity; D3DXMatrixIdentity(&identity);
// M W ←− I 4 (initialize OC to WC transform)
m _ pD3DDevice->SetTransform(D3DTS _ WORLD,&identity);
// M V ←− M w 2 e (WC to EC)
LoadViewXform();
// M P ←− M e 2 n (EC to NDC)
LoadProjectionXform();
// Clears the hardware buffer
m _ pD3DDevice->Clear( ... );
// ... exact same drawing prcedure as in 2D
theApp.GetModel().DrawModel();
.
}
Listing 15.2. The pseudocode of a typical 3D WindowHandler .
Search WWH ::




Custom Search