Why is there a hole on my sphere?

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();
}

This is not an advanced question.
You should read the spec of glLightfv, and maybe you’ll see that it expects to find an array of four floats.

SeskaPeel.

Originally posted by SeskaPeel:
This is not an advanced question.
Seskapeel is correct - this shouldn’t be in the advanced forum…

[b]
You should read the spec of glLightfv, and maybe you’ll see that it expects to find an array of four floats.

SeskaPeel.[/b]
You mean like [0], [1], [2] & [3]? As in the code provided? :stuck_out_tongue:

Seems like I misread some lines of code …
I may have been answering too fast too :slight_smile:

I’ll have to apologize for that, and ask for more code, because all that’s present here should work fine.

rpgc I hate you :stuck_out_tongue:

SeskaPeel.

If the sphere intersects the near clipping plane, it will be, well, clipped. Could be the problem here. Try reducing the radius.

Originally posted by SeskaPeel:
[b]rpgc I hate you :stuck_out_tongue:

SeskaPeel.[/b]
You’re welcome. :smiley: