Archived

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

Shabadoo

Proper camera movement

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
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