I feel stupid...

When using GLUT to render objects, how do you specify the color that GLUT uses to render?

I assumed that the current color is used, and tried this:

glColor3f( 0.0, 1.0, 0.0 );
glutSolidCube( 10.0 );

The result is that only the top side is green. All other sides are black. Culling is disabled, the lights appear to be setup correctly, switching the winding order didn’t help… what am i missing?

raise the ambient light colors.

Thanks: that certainly made the colors appear.

Now, is there any way to use the GLUT objects in a scene that does not have any ambient light? If not, can anyone recommend a free library of OpenGL 3D objects that support this feature (I imagine this means calculating the normal vectors)? We (currently) only have a single directional light in our scene and I’d hate to have to “roll our own”.


Plan on spending more time with an OpenGL book (the official guide is very good) before you can really do what you want(whatever that may be). The glut objects will be rendered in a solid color if you turn lighting off. You probably don’t want that though because they will look 2 dimensional. Try changing the light color and ambient color for each object you draw.