PDA

View Full Version : Simple Lighting Problem



elasolova
01-23-2010, 07:33 PM
Hi,

I am trying to use lighting on a simple cube. The precise code to initialize my lighting is this:

void InitLighting ()
{

glEnable(GL_DEPTH_TEST);
glEnable(GL_LIGHTING);
glEnable(GL_LIGHT0);
glEnable(GL_COLOR_MATERIAL);



}

However, when I use glEnable(GL_DEPTH_TEST) nothing appears on the screen. Is this an issue of orientation of the faces of polygons? I am really stuck.

elasolova
01-23-2010, 07:45 PM
Ok. The problem was that I had a black front face covering the other sides. However, when I do not draw that face all the other faces appear exactly the same way they did without the lighting. ???