Sign in to follow this  
nekitusan

FPS camera movement (player leaning/steps)

Recommended Posts

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]

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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().

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this