Creating Surfaces Out Of These CurvesI'm just going to scratch the surface (pun intended) of how to make curved surfaces out of Bézier curves, because this subject is big enough to fit in an article by it's self, and is beyond the scope of this article. I will only discuss quadratic bézier patches, and I will supply no code for you to look at. I will tell you how to generate points from this surface, which you can then turn into triangles or quads quite easliy.
This image is the basic idea of how a patch, made out of quadratic bézier splines, would look like. It would have 9 control points, and you can think of the surfaces x-axis running along 7,8, and 9. The y would run along 7,4, and 1. To make things simple, we'll say that the detail bias will be 0.25, which we know will generate 5 points along a spline ((1/deatil bias) + 1), but since this is a surface, it will generate 5*5 points, which is 25 points in total. It's nice to think of these points in terms of x and y, so our data structure to hold these data points will be an array that looks like this: C_POINT points[5][5]; We will also be deriving other control points as we go along, from points on other splines. I'll walk you now, step by step, the process of generating points from this surface. This is probably the most confusing part of this article, and you don't need to know this to get the basic Bézier spline working. It should be noted that when I say evaluate a spline, I mean take it's control points and create points with our equations and our detail bias, which is always 0.25. Ok here we go.
|