Original Post
i''m writing my own mesh loading class,
but have this weird problem:
whenever i rotate my mesh, the directional light i''m using
rotates with it!
my code:
anybody have an idea whats the prob?
10x
Gil Zussman gil@gilzu.com http://www.gilzu.com
void CMeshLib::Render(float dx, float dy, float dz, float dr, float dp, float di)
{
if (Loaded==false) {
return;
};
D3DXMATRIX matWorld;
D3DXMatrixTranslation(&matWorld, dx, dy, dz);
g_pd3dDevice->SetTransform(D3DTS_WORLD, &matWorld);
D3DXMatrixRotationYawPitchRoll(&matWorld, D3DXToRadian(dr), D3DXToRadian(dp), D3DXToRadian(di));
g_pd3dDevice->MultiplyTransform(D3DTS_WORLD, &(D3DMATRIX)matWorld);
// and run the vertex buffer...
}
Gil Zussman gil@gilzu.com http://www.gilzu.com