Graphics Reference
In-Depth Information
void
CDrawOnlyHandler::DrawGraphics()
Source file.
DrawOnlyHandler.cpp
file
in the
WindowHandler
folder
of
.
// Translate the center of WC to the origin
D3DXMatrixTranslation(&toPlace, -15.0f, -25.0f, 0.0);
// Scale to 2x2
D3DXMatrixScaling(&toSize, 2.0f/10.0f, 2.0f/10.0f, 1.0);
// build
M
w
2
n
operator of Equation
10.9
D3DXMatrixMultiply(&world2ndc, &toPlace, &toSize);
// Load to the VIEW matrix (
M
V
)
m
_
pD3DDevice->SetTransform(D3DTS
_
VIEW, &world2ndc);
D3D
_
TranslateWC
the
project.
Listing 10.5.
The
DrawGraphics()
function of Tutorial 10.8.
A:
CModel::CModel()
{
// CModel class constructor
.
Source file.
Model.cpp
file
in
// geometry for the torso
UWB
_
PrimitiveRectangle
*
pTorso =
new
UWB
_
PrimitiveRectangle();
pTorso->SetCorners(
vec3
(15,11,0),
vec3
(25,24,0) );
.
// geometry for the left leg
UWB
_
PrimitiveRectangle
*
pLeftLeg =
new
UWB
_
PrimitiveRectangle();
.
// defines the entire geometry for the simple person of Figure
10.10
.
// m
_
figure is a PrimitiveList
m
_
figure.Append(pTorso);
the
Model
folder
of
the
D3D
_
TranslateWC
project.
m
_
figure.Append(pLeftLeg);
.
// append all defined goemetry into the m
_
figure PrimitiveList
}
B:
void
CModel::DrawModel()
// CModel draw function
.
// Set up the WORLD matrix
m
_
xform.SetUpModelStack( m
_
DrawHelper );
// draws the
entire
goemetric human of Figure
10.10
m
_
figure.Draw( lod, m
_
DrawHelper );
.
Listing 10.6.
The
CModel
class of Tutorial 10.8.
Search WWH ::
Custom Search