02/21/2002
15-462 Graphics I
33
Example: Bezier Surface Patch
•
Use 16 control points
•
•
Initialize 2-dimensional evaluator
GLfloat ctrlpoints[4][4][3] = {...};
void init(void)
{
...
glMap2f(GL_MAP2_VERTEX_3, 0, 1, 3, 4,
0, 1, 12, 4, &ctrlpoints[0][0][0]);
glEnable(GL_MAP2_VERTEX_3);
glEnable(GL_AUTO_NORMAL);
glMapGrid2f(20, 0.0, 1.0, 20, 0.0, 1.0);
}