7 ms·
Bézier Curves and the logic behind them
- xeonmc 3y agoTwo points define a line (one vector + origin). Three points define a plane (two vectors + origin) Quadratic bezier: constructed by a velocity vector and an acceleration vector -- strictly 2D (planar curve). If you can draw a "V", then you can extend it into a parallelogram.[0] Cubic bezier: constructed by velocity, acceleration, and jerk vector -- generally non-planar 3D curves (since there are three vectors involved), only special cases are planar. [0] https://www.desmos.com/calculator/enz2qqc2ov https://www.desmos.com/calculator/enz2qqc2ov IMO Rational Quadratic Beziers are much more interesting since it defines 3D perspective, the entire field of Computer Vision can be derived from it alone.
- mathisfun123 3y agoThis isn't a bad mnemonic but it's not true in general - interpolation just means estimating missing data and you don't need to use polynomials eg gaussian interpolation is a thing. Polynomials are the most common simply because they're the easiest/fastest to fit.
- xeonmc 3y agoI've edited my comment to remove the mention of interpolation, since it was only tertiary to the point I was making and, as you said, that description sacrificed precision for brevity. Also the use of polynomial isn't exactly just due to being "easier to fit", rather it's that it's a fundamental primitive of the derivative operator, it being easier to fit is more like a "perk" that arises. Kinda like saying that "we use integers because it's easier to represent with bits" -- not wrong, just that the cause and the reward is kinda backwards.
- mathisfun123 3y ago> rather it's that it's a fundamental primitive of the derivative operator People run away with their math woo... You're just talking about an eigenspace of a linear operator. It's true polynomials are closed under d but they're not special - sinusoids are the most obvious other example. There are countless other examples as soon you start building slightly more complicated differential operators.
- bigyikes 3y agoCan someone help me understand this comment thread? It seems really interesting but it is over my head. I can understand simple calculus and linear algebra.
- selimthegrim 3y agoClosed under D just means polynomial is the derivative of a polynomial etc. just like sinusoid of sinusoid and exponential of exponential
- dahart 3y ago> strictly 2D (planar curve). A single curve segment is indeed planar, but it might be too strong to say strictly 2D? You can certainly make 3D quadratic curves. I use cubic and quadratic Beziers mostly for fur and hair, and some people do mention to me their concerns about quadrics being planar, but I think it’s not an issue in practice at all. (And quadratics are simpler and have some big advantages over cubics.) When you piece together multiple quadric segments and match tangents properly, it’s a 3D spline and you can’t really even see the planarity, each segment is a different plane. 2 quadratic segments do a pretty good job of approximating 1 cubic segment. I like thinking about B-splines more that individual segments, and for a B-spline, you can think about the difference between quadratic and cubic as more like a smoothing factor and little else.
- xeonmc 3y agowhat I meant is that any parabola, no matter how you orient it in 3D space, will always fit on a flat piece of paper, because only two vector directions are ever involved in its construction (the starting velocity and the acceleration direction). And a single quadratic bezier is simply a segment of a parabola.
- dahart 3y agoTotally, I understand and agree, I just wanted to rant for a minute about how that might not matter in practice, but obviously it depends on how you’re using the curves and what you need.
- jebarker 3y agoGot to plug this recent video as an excellent introduction to Bezier Curves: https://youtu.be/aVwxzDHniEw?si=GaBPbo2JyQHEead5 https://youtu.be/aVwxzDHniEw?si=GaBPbo2JyQHEead5
- fuzzythinker 3y agoAlso from her - The Continuity of Splines [0]. More from her site [1]. Long interactive read from Bartosz Ciechanowski [2] [0] https://www.youtube.com/watch?v=jvPPXbo87ds https://www.youtube.com/watch?v=jvPPXbo87ds [1] https://acegikmo.com/ https://acegikmo.com/ [2] https://ciechanow.ski/curves-and-surfaces/ https://ciechanow.ski/curves-and-surfaces/
- VinLucero 3y agoReminds me of Flash game animation tuning from back in the day.
- bradrn 3y agoI’m slightly surprised to see no-one has linked this yet: https://pomax.github.io/bezierinfo/ https://pomax.github.io/bezierinfo/
- jay-barronville 3y agoI discovered this primer a few years back (I'm pretty sure it was here on HN) and it was an excellent read!
- wcrossbow 3y agoAnother incredibly good and interactive exposition on Beziers https://ciechanow.ski/curves-and-surfaces/ https://ciechanow.ski/curves-and-surfaces/ His blogs always hit the top of the front page for good reasons.
- WillAdams 3y agoFor an interactive overview see: https://bezier.method.ac/ https://bezier.method.ac/
- deleted 3y ago[deleted]
- lkuty 3y agoAnother tutorial. "Bezier Curves from the Ground Up": https://jamie-wong.com/post/bezier-curves/ https://jamie-wong.com/post/bezier-curves/
- guwop 3y agowill never forget my original introduction to building bézier curves: making an aimbot look human by bezier curving the mouse path to the target!
- KineticLensman 3y ago> making an aimbot look human by bezier curving the mouse path to the target I can't remember the reference precisely but I believe in the film Dune some missiles follow Bezier curves to an estimated target position because it gives a more interesting flight path. Or something like that.
- deleted 3y ago[deleted]
- jakelazaroff 3y agoI almost skipped over this because I’m already familiar with how Bézier curves work. I’m glad I didn’t — this site is absolutely stunning!