Moving in to the direction of the camera in 3D

Started by
0 comments, last by Dominik_78 21 years, 5 months ago
Hi, so after you told me to inplement quaternions i did so. Now I am at the same problem where to move in 3D? I got my Quaternion representing the camera direction. So know how can I extract the info from the Quaternion in which direction i should "move" if the player set the throttle of my spaceship. so the rotation is okay now there is no gimbal lock anymore. I think of something like taking the verctor i am looking to and ad it to my position vector scaled by a factor that i have to balance out. but which values reperent the camera-Vector? and is this vector looking the same way the camera does? please help I am stuck with this move-thing to long now :-( thank you 3D-Game Gurus
Advertisement
You can find code all over the place to convert a quaternion to a rotation matrix. Multiply your basis vectors (1,0,0) (0,1,0) (0,0,1) by this matrix to get the camera direction.

This topic is closed to new replies.

Advertisement