FPS camera movement (player leaning/steps)

Started by
1 comment, last by nekitusan 16 years, 8 months ago
Hi, I wonder how you guys would modify a FPS camera center/target positions, or roll angle to simulate player movement, example in doom3 or other game, the camera parameters are modified to show that the player is walking. what I think would be a 'U' camera target trajectory movement in front of player, interpolating from one ending of U to the other, and repeating, please write your suggestions, thanks in advance. [Edited by - nekitusan on August 12, 2007 12:04:28 PM]
Advertisement
I would tie the horizontal and vertical movements to a sine function. That way, you'll get smooth, tweakable movements.

e.g. gunOffsetX = sin(time_value)

You merely increase the time value as the player walks, and you'll be able to have the gun move horizontally. Combined with a vertical offset (and limiting the input), you can simulate the U pretty well.
Disclaimer: "I am in no way qualified to present advice on any topic concerning anything and can not be held responsible for any damages that my advice may incurr (due to neither my negligence nor yours)"
yes, that works for the gun indeed, but for the player's "eyes" ? that's what I want to tamper with :), that scheme would work for the eyes too, but I'll have to find a frame composed of view direction, up vector and side(cross product of the first two vectors) and slide the camera position along the (side) and (-side) with a sin().

This topic is closed to new replies.

Advertisement