Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Animated Bézier Curves (jasondavies.com)
171 points by J3L2404 on April 26, 2012 | hide | past | favorite | 19 comments


Thank you, I now finally understand how Bézier curves actually work!


Second this. It is one of those things that seems so mysterious but becomes so obvious when presented in such a clear, elegant fashion.


Thirded. They is such a simple way to visualise this.


If you wish for some additional reinforcement on interpolation and splines, the presentation on this by Squirrel Eiserloh for GDC is fantastic.

http://www.essentialmath.com/tutorial.htm


There is another very interesting page on bezier curves which goes all the way into the maths you need, i.e. finding intersections, length of a curve, splitting a curve, etc. It's not animated but interactive, so drag the control points.

http://processingjs.nihongoresources.com/bezierinfo/


No, I'm pretty sure I made them animated, and added a big red text over the sketches to make sure you know they are, saying "Animated sketch, click to play" =D


At least for the "de Casteljau" algorithm that Jason also demonstrates in this HN link (in my article, it's http://processingjs.nihongoresources.com/bezierinfo/#splitti...)


The same simple explanation in the animation leads to a nice simple Haskell implementation.

Assuming you already have a parametric line function `line p q t` that interpolates between two points p and q on t in [0,1], you can recursively implement parametric Bézier on a list of control points as:

  bezier [p] t = p
  bezier ps  t = line (bezier (init ps) t)
                      (bezier (tail ps) t)
                      t
It's exponential in the number of points though ;)

(Full source at https://github.com/hrldcpr/Bezier.hs/blob/master/Bezier.hs)


As a (2D) game developer I love bezier curves. So many uses. My favorite may be that you can calculate the curve from just the end points if you know the velocity you want the object moving along the curve to have at the end.


A while back I made a little interactive demo to get my head around how beziers work... why stop at 5 points ;) - http://tholman.com/experiments/html5/bezier-curve-sim/01/?q=...


Thank you. This gives a beautiful understanding of Bézier curves.

One request: Please add pause/resume in the animation. I could just pause at any given time, and go through the state of all points. I hope it would help anyone to understand it much easily.


This is animated de Casteljau algorithm, fix the title. :)



There is another good page on the adaptive subdivision algorithm for fast bezier curves rendering: http://www.antigrain.com/research/adaptive_bezier/index.html And another one with more maths :) http://www.drdobbs.com/cpp/184403417


It's a shame about the invisible yellow lines.


I've updated the colours now, is that better?


Ah yes much better, nice work.


I wish there was a way to pause it! Cool regardess


Since upvotes are hidden: I'd love to have a way to stop/continue the animation as well.




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: