PDA

View Full Version : Shading problem of sphere



openqc
03-19-2004, 08:22 AM
Hello

I drawed three sphere as the following codes.
When I rotate the spheres, the sphere are shaded with line strips sometimes.

Please let me know how to shade the surfaces of the sphetes smoothly.

Thanks

glPushMatrix();
glShadeModel(GL_SMOOTH);
glHint(GL_LINE_SMOOTH_HINT , GL_NICEST);
glColor4ub(255,255,0,120);
gluQuadricNormals(obj,GLU_SMOOTH);
glPushMatrix();
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA,
GLONEMINUS_SRC_ALPHA);
glTranslatef(0,0,-20);
gluSphere(obj,30,100,100);
gluSphere(obj,40,100,100);
gluSphere(obj,70,100,100);
glDisable(GL_BLEND);
glPopMatrix();
glPopMatrix();