Original Post
I tried to move and rotate the camera using this class:
class CCamera
{
public:
void Rotate(double x, double y, double z);
void Move(float x, float y, float z);
};
void CCamera::Move(float x, float y, float z)
{
D3DXMATRIX mtrans;
D3DXMatrixTranslation(&mtrans, x, y, z);
D3DXMatrixMultiply(&ViewMatrix, &mtrans, &ViewMatrix);
g_lpD3DDevice->SetTransform(D3DTS_VIEW, &ViewMatrix);
}
void CCamera::Rotate(double x, double y, double z)
{
D3DXMATRIX mrot;
D3DXMatrixRotationYawPitchRoll(&mrot, y, x, z);
D3DXMatrixMultiply(&ViewMatrix, &mrot, &ViewMatrix);
g_lpD3DDevice->SetTransform(D3DTS_VIEW, &ViewMatrix);
}
The problem is that the objects rotates and not the camera. I don''t know where is the mistake, so if you could help me find it.
Thank you.