// display void display(void) { // camera and others configurations here... // NURBS glColor3f(0, 1, 0); gluBeginSurface(theNurb); gluNurbsSurface(theNurb, 8, knots, 8, knots, // knots u and v 4 * 3, 3, // offset u and v &ctlpoints[0][0][0], 4, 4, // function degree u and v GL_MAP2_VERTEX_3); gluEndSurface(theNurb); // more ... }
Problem B https://github.com/javiergs/SER431/blob/master/Lecture20/nurbs_surface_controlled.cpp * There are 7 squares (i.e., 7 curves)in blue. * You need 8 control points per square; BUT since you want to close the curve. You may should need to add the first one again. Thus 8 + 1