PatchesOkay, now that you have 2 dimensions down, lets add the third dimension into the mix. Another dimension, uh oh, how do we do that? Well, take a look at this picture:
If you are now completely confused, don’t worry, I will now explain… We start with a grid of points (P0,0 through P2,2). C0 is a quadratic bezier curve from P0,0 to P2,0 curving towards P1,0, get it? The other curves are the same, but they have different control points. Now, to get a point on the patch, we need 2 coordinates, u and v (horizontal and vertical, like texture coordinates, in this case u is about .75 and v is about .25). We use the same basis functions as a regular quadratic curve does. We find the points on curves C0, C1, and C2 like we would with 2 dimensional curves (only we use u instead of t) and we come up with points S1, S2, and S3 (corresponding to the C curves of the same numbers). Then we just use those 3 points we just found as control points for yet another curve (we’ll call it T). Finally, (using v instead of t now) we just find the point on this new curve (we’ll call it Q, like we have before in the 2 dimensional examples). Phew, glad that’s over with! Now for the equations: Getting rid of the intermediate C points… (Now you see why we use the ? symbols instead of writing the whole thing out, because without them you wouldn’t be able to make much sense of that last equation.) Okay, so that wasn’t too bad, was it? Didn’t think so. Fortunately, the cubic version is even easier to figure out because it is (again) almost exactly the same as the quadratic equation: (Again) the only difference is the number of control points and the number of basis functions. So, you see that once you understand bezier curves, then bezier patches are a piece of cake. Well, that’s it, you survived. Hope this article helped you figure out some stuff about bezier curves. For more information, check out the resource section. Please send any comments, questions or flames to tutorials@mskinn99.freeservers.com.
|