4 ms·
I wonder if I'm falling into the trap where a moderately interesting article with something clearly misleading about it makes me want to correct things. "Drives
by turtledragonfly 4y ago
I wonder if I'm falling into the trap where a moderately interesting article with something clearly misleading about it makes me want to correct things. "Drives engagement" I suppose (:
But yeah, please don't call this lerping, as others have mentioned.
Real lerp is one of a a whole constellation of easing functions[1][2], and indeed playing with variations of "how does f(t) vary from 0–1 as t varies from 0–1" is super useful in all sorts of contexts.
But "get X% closer to the (moving) target every frame" is a more complicated thing. It is not just a f(t) easing function, even if the math overlaps.
In fact, this confusion has already had articles written about it[3] so I swear it's not just me!
I don't think the approach mentioned in TFA is wrong per-se. Situations vary, and it can be useful. But there is enough terminology confusion in CS already.
One downside of the approach: you never know _when_ you'll reach your target. Also, especially with the slider example, the feedback feels much more "sloppy." I much prefer the tighter-feeling simple version. But in some cases, like when an enemy is chasing you in a video game, it can be a useful simple-to-implement technique. Be sure to cap your min/max velocities, though.
[1] https://github.com/Michaelangel007/easing https://github.com/Michaelangel007/easing
[2] https://easings.net/ https://easings.net/ (CSS-centric)
[3] https://medium.com/swlh/youre-using-lerp-wrong-73579052a3c3 https://medium.com/swlh/youre-using-lerp-wrong-73579052a3c3
- jesse__ 4y agoIronically, the person who posted this article on lerp also posted the article you linked to in [3], which calls out exactly the problem with this article. What a weird series of events..
- jagged-chisel 4y agosurprisetalk submitted the article to HN. Presumably their name is Taylor because their HM profile links off to a place claiming the name Taylor. The article titled Lerp is hosted on a site where it appears that Rach Smith is the author. The author in GP's [3] You’re Using Lerp Wrong is Matt Harzewski. What did I miss that makes "the person who posted this article on lerp also posted the article you linked"?
- jesse__ 4y agoSorry, that was a comically ambiguous statement. Taylor (surprisetalk) also submitted article [3] to HN today, and wrote neither. The irony I saw is that article [3] linked above directly addresses the shortcomings of the article discussed here.