Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Shabadoo

Proper camera movement

This topic is 6097 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

Hi all, I''ve got a problem with my camera movement. I can''t figure out how to make my camera position move properly in relation to the direction it is facing. For example, say i rotate the camera to face NW, when i try to strafe right, how do i get the camera to move NE instead of directly east? I am using a vector for the camera position and am storing the rotation in a quaternion, i can get a vector out of my quaternion telling me exactly where i am facing, i also have a velocity vector that is added to/subtracted from when the movement keys are pressed. Thanks Shabadoo

Share this post


Link to post
Share on other sites
Advertisement
Since you have a "forward" vector, all you need is to do a 90° rotation to get the "side" vector.

If your are looking along a (X,Y) vector, then (Y,-X) is to your right.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!