

Connect control points by segments: 1 → 2, 2 → 3, 3 → 4.The demo for 4 points (points can be moved by a mouse): It’s red and parabolic on the pictures above. The set of such points forms the Bezier curve. On pictures above that point is red.Īs t runs from 0 to 1, every value of t adds a point to the curve. That is, for t=0.25 (the left picture) we have a point at the end of the left quarter of the segment, and for t=0.5 (the right picture) – in the middle of the segment. Now in the blue segment take a point on the distance proportional to the same value of t. On the picture below the connecting segment is painted blue. As there are two segments, we have two points.įor instance, for t=0 – both points will be at the beginning of segments, and for t=0.25 – on the 25% of segment length from the beginning, for t=0.5 – 50%(the middle), for t=1 – in the end of segments.Ĭonnect the points. On each brown segment we take a point located on the distance proportional to t from its beginning. In the example above the step 0.05 is used: the loop goes over 0, 0.05, 0.1, 0.15. In the demo above they are labeled: 1, 2, 3.īuild segments between control points 1 → 2 → 3. Try to move control points using a mouse in the example below:ĭe Casteljau’s algorithm of building the 3-point bezier curve:ĭraw control points. The main value of Bezier curves for drawing – by moving the points the curve is changing in intuitively obvious way. Checking the intersection of convex hulls is much easier, because they are rectangles, triangles and so on (see the picture above), much simpler figures than the curve. So checking for the convex hulls intersection first can give a very fast “no intersection” result. If convex hulls do not intersect, then curves do not either. The curve order equals the number of points minus one.įor two points we have a linear curve (that’s a straight line), for three points – quadratic curve (parabolic), for four points – cubic curve.Ī curve is always inside the convex hull of control points:īecause of that last property, in computer graphics it’s possible to optimize intersection tests. That’s perfectly normal, later we’ll see how the curve is built.

If you look closely at these curves, you can immediately notice:
