/* Draws a bivariate cubic Bezier surface, automatically creating normals. The first argument is a boolean, saying whether to draw it solid or wireframe. The second is the number of steps in each dimension, and the third is an array of control points. This function isn't quite ready yet; it needs to be more flexible about the stride and number of control points. */ void twDrawBezierSurface(boolea wirep, int nsteps, GLfloat* control_points) { glEnable(GL_AUTO_NORMAL); // automatically compute the normals glMap2f(GL_MAP2_VERTEX_3, 0,1,3,3, 0,1,9,3, control_points); glEnable(GL_MAP2_VERTEX_3); // set up grid and generate the desired surface glMapGrid2f(nsteps, 0, 1, nsteps, 0, 1); glEnable(GL_NORMALIZE); if(Wire) glEvalMesh2(GL_LINE, 0, nsteps, 0, nsteps); else glEvalMesh2(GL_FILL, 0, nsteps, 0, nsteps); }