PDA

View Full Version : strafe



schwinn
02-07-2002, 11:41 AM
I am using gluLookAt to position my camera.
It's initial value is
gluLookAt( 0, 10, 15, 0, 0, 0, 0, 0, 1);
To strafe right and left, I add (or subtract) a constant value to (or from) the eye's x value and the center x value. This seems to be ok.
Now I want to strafe up and down but I'm not sure how. If I was using glTranslate, I would just change the y value but just adding or subtracting to the eye and center y values doesn't work. Just changing the center y value pans not strafes.
I just want to move my look vector up and down, keeping its length and orientation the same.

Jambolo
02-08-2002, 09:01 PM
You set the UP vector to point along the Z axis. So, you strafe up and down by changing the Z values, not the Y values.