Upcoming Events
Unite 2010
11/10 - 11/12 @ Montréal, Canada

GDC China
12/5 - 12/7 @ Shanghai, China

Asia Game Show 2010
12/24 - 12/27  

GDC 2011
2/28 - 3/4 @ San Francisco, CA

More events...
Quick Stats
63 people currently visiting GDNet.
2406 articles in the reference section.

Help us fight cancer!
Join SETI Team GDNet!
Link to us Events 4 Gamers
Intel sponsors gamedev.net search:

Contents
 Introduction
 Curves
 Patches

 Printable version
 Discuss this article

Curves

Now, how about a bezier curve? We want the line from P0 to P2 to curve towards P1, like so:


Figure 2: Quadratic Bezier Curve

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.).



Next : Patches