Scientific Visualization and Animation using Bezier Surfaces
An Introduction
|
Prof. David Bernstein
James Madison University
|
|
Computer Science Department
|
bernstdh@jmu.edu
|
Mathematical Representation
- Control Points:
- Let \(p_{ij}\) denote control point \((i,j)\)
- The patch will be in the convex hull of the
control points
- Blending Polynomials:
- We have one array of blending polynomials for each
parameter
- The Bezier Patch:
- \(p(u,v) = \sum_{i=0}^{n} \sum_{j=0}^{m} b_{i}(u) b_{j}(v)
p_{ij}\)
Bezier Surfaces in OpenGL
- Evaluators:
- Are used in the same way as for Bezier curves (i.e., to
compute the values for the Bernstein polynomials)
- For Uniform Meshes:
-
glMapGrid2f()
)
-
glEvalMesh2()
Bezier Surfaces in OpenGL (cont.)
Using an Evaluator
svaexamples/surfaces/edit.c
(Fragment: mesh)
Bezier Surfaces in OpenGL (cont.)
Initialization
svaexamples/surfaces/edit.c
(Fragment: setup)
A Simple Surface Editing Program
svaexamples/surfaces/edit.c
Adding Lighting and Shading
Using the Evaluator to Fill
svaexamples/surfaces/shade.c
(Fragment: surface)
Adding Lighting and Shading (cont.)
Initialization
svaexamples/surfaces/shade.c
(Fragment: setup)
There's Always More to Learn