diff options
author | delta <darkussdelta@gmail.com> | 2025-03-15 15:59:41 +0100 |
---|---|---|
committer | delta <darkussdelta@gmail.com> | 2025-03-15 15:59:41 +0100 |
commit | 16bdab2a899bf4ed120e10a889c320304b561130 (patch) | |
tree | edef5f0e53dbaf2730cb112c4eff887db5aef04d | |
parent | 087906bae8004a889b50f522a6d6605e8be21a69 (diff) |
new post
-rw-r--r-- | assets/css/main.css | 10 | ||||
-rw-r--r-- | blog/a_cautionary_tale.md | 12 |
2 files changed, 21 insertions, 1 deletions
diff --git a/assets/css/main.css b/assets/css/main.css index edd431a..835b6f9 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -146,7 +146,7 @@ nav > ul { main { flex-grow: 1; width: 80vw; - line-height: 1.5; + line-height: 1.6; } nav > ul { @@ -230,3 +230,11 @@ main ul:not(:last-child) { strong { font-weight: bold; } + +code { + background-color: var(--bg-low); + padding: var(--padding); + border-radius: var(--border-radius); + font-family: "Aporetic Mono", monospace; + text-wrap: nowrap; +} diff --git a/blog/a_cautionary_tale.md b/blog/a_cautionary_tale.md new file mode 100644 index 0000000..8a74c00 --- /dev/null +++ b/blog/a_cautionary_tale.md @@ -0,0 +1,12 @@ +--- +title: A cautionary tale +date: 15-03-2025 +--- + +So, I, being the animation connoisseur that I am, one boring evening decided to implement cubic Bézier easing in rubato (as one does on boring evenings). + +Thus, with my cat ears and thigh highs on, off I went in search of resources on Bézier curves. Upon discovering [several](https://stackoverflow.com/questions/2549706/quadratic-bezier-curve-y-coordinate-for-a-given-x) [Stack Overflow](https://math.stackexchange.com/questions/26846/is-there-an-explicit-form-for-cubic-b%c3%a9zier-curves/348645#348645) [posts](https://stackoverflow.com/questions/34455714/custom-animation-using-cubic-bezier-function) and spending a good two days pounding my head against the wall, I finally managed to find an [implementation](https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/graphics/UnitBezier.h) (which still needed to be adapted to use the derivatives that rubato required). After first trying my hand at that using https://pomax.github.io/bezierinfo as a reference—failing miserably—and even bothering my local smart person, missing, for help (which also failed, because derivatives), I decided to contact the author of rubato, [Orlando](https://github.com/andOrlando). + +We spent about an hour discussing a solution to my predicament, and in the end we came to the conclusion that while a cubic easing function could be approximated by tweaking the intro and outro durations and altering the easing function, I should simply use another library that doesn't use derivatives for specifying the easing function. This stemmed from the fact that for every well-defined cubic Bézier curve (i.e., `A = (0,0)`, `D = (1,1)`, and `B` and `C` are both in the range `[0–1]`), both the start and the end of the function would be at `y = 0`, making it incompatible with rubato's model (except when intro = 1, which would defeat the purpose of using rubato as an interrupt-friendly interpolator in the first place). + +The moral of the story? Don’t rice, kids. |