Camera rotation/movement in 3D world
hmm.. I seem to be having some troubles with moving a camera in 3D space.. I've read through some tutorials and tried writing some code but I just cannot get the effect I want..
1) When up or down is pressed on keyboard I want the camera & view to move up or down (like someone is wearing a jetpack and is flying)
2) When left or right is pressed on the keyboard i want the camera to rotate around a point vertically
Can someone tell me the steps i need to accomplish this?
1) Check for keyboard input
2) Find the direction between camera & view
3) Find the cross product between direction & upvector
4) Normalize the cross vector
5) who knows ???
Am i even on the right track? I've looked at code that rotates the camera around a point horizontally and strafes the camera left and right but i can't understand the math.. anyone have a good site that explains the math involved with some diagrams or something? I can't picture the upvector or the cross product vector in my mind... its making it difficult to imagine what axises i need to rotate about... thnx for any help
[EDIT] i've messed around a bit more and i got the camera to act like someone is wearing a jetpack.. though i doubt i did it correctly...
can someone tell me if this is the correct way to go about this? it works though i haven't tried rotating the camera so i don't know if this code will still work since i noticed in camera strafing left/right you find the cross product of the camera's direction and camera's up vector.. though i couldn't get camera to go up/down unless i removed the cross product thing...
1) Camera view - camera position = camera direction
2) Camera position = Camera position + camera direction * constant speed
3) Camera view = Camera view + camera direction * constant speed