The hole is where the light is directed at. When I rotate the coordinate, it seems I can see through the hole?! However if I switch froM GLU_FILL to GLU_LINE, it looks just fine. I didn’t use any material or texture. Can anyone help?
void __fastcall TMain::CreateLight(GLfloat r, GLfloat g, GLfloat b)
{
m_lightAmb[0]=r; m_lightAmb[1]=g;
m_lightAmb[2]=b; m_lightAmb[3]=1.0f;
m_lightDif[0]=1.0f; m_lightDif[1]=1.0f;
m_lightDif[2]=1.0f; m_lightDif[3]=1.0f;
m_lightSpe[0]=0.8f; m_lightSpe[1]=0.8f;
m_lightSpe[2]=0.8f; m_lightSpe[3]=1.0f;
m_lightPos[0]=1.0f; m_lightPos[1]=.0f;
m_lightPos[2]=-1.0f; m_lightPos[3]=0.0f;
glLightfv(GL_LIGHT0,GL_AMBIENT,m_lightAmb);
glLightfv(GL_LIGHT0,GL_DIFFUSE,m_lightDif);
glLightfv(GL_LIGHT0,GL_SPECULAR,m_lightSpe);
glLightfv(GL_LIGHT0,GL_POSITION,m_lightPos);
glShadeModel(GL_SMOOTH);
glLightModeli(GL_LIGHT_MODEL_LOCAL_VIEWER, GL_TRUE);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
}
void __fastcall TMain::AddSphere()
{
GLUquadricObj* quadObj;
glNewList(Sphere,GL_COMPILE);
quadObj=gluNewQuadric();
gluQuadricDrawStyle(quadObj,GLU_LINE);
gluQuadricNormals(quadObj,GLU_SMOOTH);
gluSphere(quadObj,1,8,8);
glEndList();
}