logoalt Hacker News

spacechild1today at 1:27 PM1 replyview on HN

That's basically a one-pole low pass filter. You can use this for smoothing any kind of data that arrives at a steady rate.

You can also dynamically calculate the filter coefficient based on the current delta time, which makes sure that the smoothing behavior is independent from the current framerate.


Replies

mightyhamtoday at 1:37 PM

Thanks, I added a formula for a dynamic filter coefficient to my original comment. It makes sense intuitively to me, but I'm also not certain if the exact formula I provided is correct.