Framerate independance when blending camera movement?

Started by
2 comments, last by harryx 22 years, 2 months ago
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?
Advertisement
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

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

This topic is closed to new replies.

Advertisement