Setting Up Buffers for a Generic Surface

text only
 
progress indicator progress indicator progress indicator progress indicator

In Conclusion

This chapter completes the progression from simple Bezier surfaces to more flexible NURBS surfaces. The samples included with this chapter don't specifically take advantage of NURBS features, but all the groundwork is laid for you to experiment with changes to knot vectors, weights, and control point positions . I would recommend continuing on to the next chapter to see other examples. After that, you might want to return to this chapter to experiment with shapes and models of your own. Remember, it's okay to hack through the source code because you can always get a fresh copy off the CD if you make mistakes. Before moving into the samples in the next chapter, here's a quick review of the basic ideas.

  • The NURBS equations are based on the same principles described in Chapter 5 and in Chapter 7. If you are uncomfortable with the equations, review those two chapters. Chapter 5 will refresh you on NURBS, and Chapter 7 describes the basics of moving to a 2D parametric space.

  • The code for NURBS surfaces is extremely similar to the code for B-spline surfaces because I cache the basis function values in exactly the same way. The weight factors are not taken into account until FillPatchBuffer because of the way they factor into the partial derivatives.

  • As usual, there are many areas of the code that could be optimized depending on how you wanted to optimize (memory vs. speed, and so on).

  • The space ship example is used to show that NURBS surfaces are not just wavy sheets, but the same principles apply to B-spline surfaces as well. You could even implement the space ship as a Bezier surface, but you'd be subject to all the limitations of Bezier surfaces.

  • The space ship was modeled by hardcoding vertex positions. There are NURBS tools such as Rhino that are much better for modeling.

  • NURBS surfaces (or any of the other mathematical representations) have advantages over polygonal models because they encode the features of the surface in a more compact and flexible form.

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