4 ms·
> I wasn’t sure what type of math function would work for this Usually people use "easing functions", which are convenient since they typically have a range an
by emmanueloga_ 3y ago
> I wasn’t sure what type of math function would work for this
Usually people use "easing functions", which are convenient since they typically have a range and image both in [0.0 .. 1.0] [1] (although sometimes the range is slightly above 1 or below 0 to produce some "effect"). CSS has a cubic-bezier function [2] that can be used to replicate pretty closely all sorts of easing functions.
Functions that look like an "S" when plotted are called "sigmoids", a popular one used in graphics applications is called "Smoothstep" [3].
--
1: https://easings.net https://easings.net
2: https://developer.mozilla.org/en-US/docs/Web/CSS/easing-function#cubic_b%C3%A9zier_easing_function https://developer.mozilla.org/en-US/docs/Web/CSS/easing-func...
3: https://en.wikipedia.org/wiki/Smoothstep https://en.wikipedia.org/wiki/Smoothstep
- trafnar 3y agoThanks, I briefly tried using an easing curve for this and somehow my brain wasn't playing along. I'll give it another look because, yeah, that does seem like the way to do it.