glColour3f doesn't work on my gluSphere

Here is some code:

Slow and nasty wireframe sphere drawing. Upside is it requires no storage.
void CSphere: :Draw(void) const

glTranslatef(m_Centre.x, m_Centre.y, m_Centre.z);

GLUquadricObj *SphereObj = gluNewQuadric();
gluQuadricDrawStyle(SphereObj, GLU_LINE);
gluSphere(SphereObj, m_Radius, 15, 10);



As you can see I’ve tried to insulate the function from my main codebase, though for some reason the wireframe still remains black…

Note : This functions is a simple way for me to see a sphere primitive in game, hence I don’t use any local storage. This is used to see bounding spheres during collision test debugging.

Many thanks


[This message has been edited by gimp (edited 02-12-2001).]

When using GL lighting you need to specify materials for objects you draw.

Although I always thought the default material was solid white, not black.


Try use glutWireSphere instead, just to see that nothing is wrong with the way you draw your sphere.


Probably should have used that from the beginning. The problem however isn’t fixed…

As a matter of interest, I placed a light next to the object within the sphere and it gets lit while the sphere does not.

Then I commented out the disabling of lighting in the above function. The sphere is not affected by lighting.

This is quite odd…

Try looking at gluQuadricNormals.

I have lighting turned off, what would normals have anything to do with it? Besides I’m now using glutWireSphere.

Any other takers?

Got it!

I was screwing with the texture loader when it broke. All the spheres turned white.


The Sphere was attempting to use the currently bound texture.

That means I have a few things to fix…