Extending the Basic Application to 3D

text only
 
progress indicator progress indicator progress indicator progress indicator

From B-Spline Curves to Surfaces

In Chapter 7, you saw that Bezier curves and Bezier surfaces shared essentially the same equations. The only difference was that the surface equation employed basis functions in both parametric directions. B-spline surfaces are no different. Equation 8.1 extends B-spline curves to surfaces. In this case, k is the order in the u direction and l is the order in the v direction.

(8.1) Equation for B-spline Surfaces. 

The basis functions are derived exactly as they were in Chapter 4, "B-Splines." For clarity, I repeat them in Equation 8.2, but they are the same as you saw in Equation 4.1.

This implies several things. First of all, the order can be different in both directions. Also, you can have different knot vectors in the two parametric directions. In all, the concepts you learned in Chapter 4 all apply here and can be applied differently in the u and v directions. For instance, the surface might be uniform and open in the u direction and periodic in the v direction. For a tube-shaped surface, you might want to use the techniques used to define a closed shape in one direction and use a simple second-order line in the other.

(8.2) B-spline surface basis functions. 

Computing the normal vector on a B-spline surface follows the same basic technique that was shown in Chapter 7. First, you need to express the partial derivatives of Equation 8.1 with respect to u and v as shown in Equation 8.3.

(8.3) Partial derivatives of Equation 8.1. 

Then, you need to find the derivatives of the basis functions (see Equation 8.4). The two derivatives are both instances of the derivatives you used in Chapter 4.

Once you have all the pieces, the normal vector itself is computed using the code shown in Chapter 7.

(8.4) Derivatives of the basis functions. 

This is basically all you need in terms of theory. If you already understand B-spline curves, surfaces are actually very straightforward. If you still aren't sure how the 2D pieces fit together, the implementation will probably clarify things.

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