dont be condescending
this is the render model method:
models hold the material info, texture number (points to a texture array) and the mesh. Textures and meshes loaded using native D3DXLoadMeshFromX, D3DXCreateTextureFromFile, nothing out of the ordinary.
Code:
void cGraphics::RenderModel(int iModelNum, float fPosX, float fPosY, float fPosZ, float fRotX, float fRotY, float fRotZ) {
//temp matrices
D3DXMATRIX Rotation_Matrix;
D3DXMATRIX Translation_Matrix;
D3DXMATRIX World_Matrix;
//rotations
D3DXMatrixRotationYawPitchRoll(&Rotation_Matrix, fRotY, fRotX, fRotZ);
//position
D3DXMatrixTranslation(&Translation_Matrix, fPosX, fPosY, fPosZ);
//combine rotation and position
World_Matrix = Rotation_Matrix * Translation_Matrix;
//apply world transforms
p_device->SetTransform(D3DTS_WORLD, &World_Matrix);
//draw model subsets
for(int i = 0; i < Model[iModelNum].iTexNum.size(); i++)
{
p_device->SetMaterial( &Model[iModelNum].Material[i] );
p_device->SetTexture(0, Textures[Model[iModelNum].iTexNum[i]]);
Model[iModelNum].Mesh->DrawSubset(i);
}
}