I am rendering a NURBS patch and some control points. As soon as I render the control points the NURBS patch goes completely dark.
void drawNURB() {
glPushMatrix();
GLfloat diffuseColor[] = {0.8, 0.8, 1.0, 1.0};
glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuseColor);
glMatrixMode(GL_MODELVIEW);
gluBeginSurface(nurbRenderer);
gluNurbsSurface(nurbRenderer,
sKnotCount, sKnot,
tKnotCount, tKnot,
sStride, tStride,
ctlArray,
sOrder, tOrder,
GL_MAP2_VERTEX_3);
gluEndSurface(nurbRenderer);
glPopMatrix();
}
void drawCtl() {
glPushMatrix();
GLfloat diffuseColor[] = {0.8, 0.8, 1.0, 1.0};
glMaterialfv(GL_FRONT, GL_DIFFUSE, diffuseColor);
glMatrixMode(GL_MODELVIEW);
int i;
for (i = 0; i < ctlNum; i++) {
glPushMatrix();
glTranslatef(ctlArray[(3*i)], ctlArray[(3*i)+1], ctlArray[(3*i)+2]);
glutSolidSphere(.5, 4, 4);
glPopMatrix();
}
glPopMatrix();
}
void display (void) {
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
setUpLight();
setUpView();
drawNURB();
drawCtl();
glutSwapBuffers();
}
Am I doing anything bad in these calls? Thanks in advance for the help.