glEvalMesh2 w/ glutSolidSphere

Started by
1 comment, last by Bretttido 22 years, 5 months ago
Hi, I''m having a bit of problem in my program when I attempt to create a 2D Bezier surface with glEvalMesh2 AND create a glutSolidSphere. The Bezier surface works just fine alone; however, when I add glutSolidSphere anywhere in the program, the Bezier surface is no longer lit correctly. Anyone know where my problem may be coming from?
Advertisement
Well, I figured out how to fix the problem... though why this works, I''m really not sure. After making a call to glutSolidSphere (or gluSphere), the glNormal seems to be modified. Changing it back to (0,0,1) seems to allow the Bezier curve to be lit properly.
check out the source to glut to see whats happening

void APIENTRY
glutSolidSphere(GLdouble radius, GLint slices, GLint stacks)
{
QUAD_OBJ_INIT();
gluQuadricDrawStyle(quadObj, GLU_FILL);
gluQuadricNormals(quadObj, GLU_SMOOTH);
/* If we ever changed/used the texture or orientation state
of quadObj, we''d need to change it to the defaults here
with gluQuadricTexture and/or gluQuadricOrientation. */
gluSphere(quadObj, radius, slices, stacks);
}

gluSphere generates its own normals thus the last normal used will be the current normal when u leave the function

use glGetFloat(...) with GL_CURRENT_NORMAL to find the currently active normal

This topic is closed to new replies.

Advertisement