Coding Math: Episode 20 - More on Bezier Curves

preview_player
Показать описание
This week we discover a couple of neat tricks to using Bezier curves.

Рекомендации по теме
Комментарии
Автор

"Well, I don't suppose you're buying this drama" HAH that's just gold.
Love the series! Learning a lot. I have a decent background in physics and programming but combining the two would've been very hard without you so keep up the good work! Loving it!!!

milen
Автор

I had a hard time understanding your multicurve function, but now I get it. It's basically: start at point 0, calculate the mid of the next two points (1 and 2). Create a loop for t for quadraticBezier(0, 1, mid, t, pFinal). At the end of the iteration, the mid point is the new starting point (0 = mid).

naraksama
Автор

You are really good, like watching NETFLIX, I can't stop watching and coding. My lesson fav so far ? Edge the springs(!), though I had to do them

johnconley
Автор

I am deeply thankful for this! Blessings!

AngelHdzMultimedia
Автор

if you rearrange the terms it becomes really easy to understand the formula, and thus to extrapolate it to use more control points (probably as many as you like), and even to automate it as a for loop fed with an array of points.
allow me to illustrate the reordered terms:

Bezier ( a, b, c, v ){ // a b c are points, v is the interpolation value

w = 1 - v;

result = a * (w*w)
+ b * (w*v) * 2
+ c * (v*v);

}


Bezier ( a, b, c, d, v ){ // a b c d are points, v is the interpolation value

w = 1 - v;

result = a * (w*w*w)
+ b * (w*w*v) * 3
+ c * (w*v*v) * 3
+ d * (v*v*v);

}


Bezier ( a, b, c, d, e, v ){ // a b c d e, are points, v is the interpolation value

w = 1 - v;

result = a * (w*w*w*w)
+ b * (w*w*w*v) * 4
+ c * (w*w*v*v) * 4
+ d * (w*v*v*v) * 4
+ e * (v*v*v*v);

}

and so on, it's easy to see how this could be automated into a generalized function with n points

jgcooper
Автор

I'd love to know how to find any points of intersection (accurately) of two different Bézier curves. And also of different types of paths, such as arcs, lines. (Intersections between all type, not just intersections between the same types.)

Finding the points of intersection is an important step in adding and subtracting shapes without relying on clips and masks. (The stroke of two shapes may acquire strange effects if someone relies on clips and masks.)

World_Theory
Автор

You are my hero 😍 Thank you for the video 💪

goikk
Автор

javascript :) ... absolute useful man. thanks

FerchoNossa
Автор

Did you wrote a paper about this because i really wanna use it in my bachelorthesis about curves in gamedevelopment

begrateful
Автор

10:10 I really want to know the difference of your function and the canvas function. is it just run with more iterations or with more detailed numbers, are canvas functions run differently than custom JavaScript functions?

jim_o
Автор

Can we calculate control points with start and end point given ? I want to draw a curve with certain given inclination every time for any given start & end points

zaibaas
Автор

Thanks for making this video! I'm wondering, is it possible to keep the curve on every point when calculating a multicurve? The formula in the start of the video doesn't work then (the curves don't line up properly).

nicolaigd