Smoothing a variable in time
Hi all,
I have to smooth the value of a variable (x) over the time. The formula I''m using is:
x = x*alpha + NewX*(1-alpha)
with some smoothing parameter ''alpha'' in the interval [0,1].
This code is called once per frame, my problem is that the "smoothing velocity" of the variable clearly depends on frame rate.
I have the time passed since last calculation. How can I use this time parameter to make sure that the smoothing velocity is always the same regardless of the framerate? Any idea?
Thanks.
Something like:
alpha = alpha^time
x = x*alpha2 + NewX*(1-alpha2)
time being scaled as necessary, with a thresdhold.
alpha = alpha^time
x = x*alpha2 + NewX*(1-alpha2)
time being scaled as necessary, with a thresdhold.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement