Sign in to follow this  

D3D9 Rotate Camera Correctly

This topic is 1959 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
[code]
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?
[/code]

Share this post


Link to post
Share on other sites

This topic is 1959 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this