Jump to content

  • Log In with Google      Sign In   
  • Create Account


D3D9 Rotate Camera Correctly


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
No replies to this topic

#1 Muzzy A   Members   -  Reputation: 635

Like
0Likes
Like

Posted 07 August 2012 - 12:26 AM

Hey, I'm trying to rotate my camera around in space. It works, but the camera matrix gets broke and it gets difficult to level the camera with the horizon again.

to rotate the camera im simply doing this
Matrix rot;
// rotate the camera in the direction the mouse moves
D3DXMatrixRotationY(rot,ToRadian(-MouseX));
cam *= rot;

// OK first of all, i know that after doing this rotation that it breaks the matrix, second I know how to fix it, you have to reset the XAxis and ZAxis by
// I do it by doing cross products in OpenGL, but the matrices are different in directX and i dont know where the forward vector is or where the
// right vector or anything is inside the matrix, only the position.

// But im not even sure if it's set up like that, any help?


Sponsor:



Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS