Skip to main content
gamedev.net
🔒 Locked

Problem while moving the camera

Started by Alload 0 replies 100+ views
Original Post
Alload
Alload
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.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.