Jump to content
  • Advertisement
Sign in to follow this  
nekitusan

FPS camera movement (player leaning/steps)

This topic is 3965 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
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.

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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!