Advantages of NURBS Surfaces over B-Spline Surfaces

text only
 
progress indicator progress indicator progress indicator progress indicator

Extending Curves to Patch Surfaces

In the previous curve chapters, you saw how to use a 1D parameter to control a 2D or 3D curve. Values of t moved you along a curve, and in the code examples, that curve consisted of a set of points on a 2D plane. Remember, the curves also work in 3D, but I limited them to 2D for clarity. This chapter introduces the idea of using a two-dimensional parametric space to control the shape of a 3D surface. The basic ideas shown in this chapter will apply to all surfaces.

Note 

Parametric surfaces could also be 2D, but that is not usually very interesting. One case where it could be interesting is if you wanted to use the mathematics behind curves as the basis for 2D image warping and morphing.

As a point of reference, Figure 7.1 shows diagrams of 1D and 2D parametric spaces. The upper diagram shows the 1D space that I used for curves. In that case, the curve was controlled by one parameter, t. Movements through the 1D space resulted in movements along the curve. The lower diagram is the 2D space used for surfaces. In this case, I have defined the parameters as u and v. Movement within the 2D parametric space corresponds to movement along the 3D surface.


Figure 7.1: Parametric spaces.

This would be a good point to stress the difference between parametric space and the surface itself. Although the parametric space is 2D, you are not limited to 2D surfaces. Imagine you have a real 3D sheet of paper (this book contains roughly 150 of them). The surface of that sheet of paper defines a 2D parametric space, but each point on that surface is somewhere in 3D space. If you crumple the paper, the parametric value for a given point is the same, but the 3D position will change. Figure 7.2 shows that the same parametric point (u, v) can have different locations (x, y, z) depending on the state of the surface.


Figure 7.2: Parametric points on a surface.

The point of Figures 7.1 and 7.2 is to show that surfaces are extremely similar to curves. With a curve, the 1D parameter t can define a point somewhere on that curve. With a surface, the 2D parameters u and v can define a point somewhere on the surface. Once you understand that, it is very easy to extend the curve ideas to surfaces.

Looking back to the previous chapters, each point on a curve is influenced by each control point. The basis functions determine the amount of influence. In the case of surfaces, the same basic idea holds, only now control points in two dimensions exert influence on each point on the surface. The control points for a surface are now arranged in a control grid , as shown in Figure 7.3. In the case of Bezier surfaces, each control point affects each point on the surface for the same reasons that all the control points affect all the points on a Bezier curve.


Figure 7.3: Control grid for a parametric surface.

The equation for surfaces is basically the same equation you saw for curves, only now you take into account the extra dimension. Equation 7.1 is the equation for Bezier surfaces.

(7.1) Equation for Bezier surfaces. 

Notice the similarity with Equation 3.6. It looks a little more complicated, but it is essentially the same equation in two dimensions. Here the contribution of each control point is scaled by two basis functions-one in each dimension. The Bernstein basis functions in this case are exactly as described in Chapter 3, "Parametric Equations and Bezier Curves," so I will not go over them again.

In short, both curves and surfaces are made up of a set of points. In both cases, those points are computed as the weighted sums of the influences of the control points. In the case of curves, those control points existed in one parametric dimension-"along the curve". In the case of surfaces, the control points exist in two parametric directions on the surface. Conceptually, Equations 3.6 and 7.1 are basically the same. The main difference is that the latter accounts for the second parametric direction.

progress indicator progress indicator progress indicator progress indicator


Focus on Curves and Surfaces
Focus On Curves and Surfaces (Focus on Game Development)
ISBN: 159200007X
EAN: 2147483647
Year: 2003
Pages: 104
Authors: Kelly Dempski

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net