CurvesNow, how about a bezier curve? We want the line from P0 to P2 to curve towards P1, like so:
We interpolate from P0 to P1 to get S0. We interpolate from P1 to P2 to get S1. Finally, we interpolate from S0 to S1 and end up with Q. Simple, right? Phew, what a mess! Lets try to make that into one equation, okay? And now our new basis functions (one for each point): And the new equation becomes: That, my friends, is the 2 dimensional equivalent of a bi-quadratic bezier patch. It’s called a quadratic bezier curve. So, what about cubic curves? Fortunately, the equation is almost identical: The only difference is the number of basis functions and the number of points (4 of each). The new basis functions are shown below (I won’t derive them, but you can if you want to): Simple, huh? Not too much effort besides finding the new basis functions. Now, if you wanted to create a higher order bezier curve (more control points and basis functions) the general formula is shown: Where i is the number of the basis function (0 through n) and n is the order (for a line this is 1, for a quadratic bezier this is 2, for a cubic bezier this is 3, etc.).
|