Archived

This topic is now archived and is closed to further replies.

Framerate independance when blending camera movement?

This topic is 5772 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

My game runs independant of framerate for every aspect except one. For most things I obviously just multiply velocity by the time it took to render the current frame. However I smooth my camera movement with a function that interpolates the calculated camera position with the camera position of the previous frame: cam=cam*.1+oldcam*.9; Is there anyway I can make this camera lag independent of framerate?

Share this post


Link to post
Share on other sites
this was answered in an older post (not by me) using interpolation between mouse positions.


NewX += (oldmouseX - newmouseX)/N;



Try N=2.

I think thats ok, I would look up the previous post though, I''m assumning Mouse is what you use to move the camera (quake like).

,Jay

Share this post


Link to post
Share on other sites
Cheers, but thats not really what I meant.

Its for a 3rd person view where the camera focuses on the player and follows them around (Mario 64 etc).

The smoothing is done just to add a bit of lag so that the camera doesnt look like it is rigidly attatched to the player.

Thanks anyway...

Share this post


Link to post
Share on other sites
simple, make your movemnet COMPLETLY independent of your framerate. this means using a fixed time step loop instead of multipling by a time factor. a search on flipcode or gamedev will provide the info you seek. this method garuntees thta movement is purly independet of framerate, but you will still have to interpolate the frames which you seem to know how to do already.

Share this post


Link to post
Share on other sites