PDA

View Full Version : How to enable light when using color infomation



kangarooxy
07-30-2003, 06:11 PM
Dear all,
I try to use color and light simutaneously in my program:

glBegin(GL_TRIANGLE_STRIP);
for(int k=0;k<m;k++)
{
glColor3f( , ,);
glNormal3f( , , );
glVertex3f( , , );
}
glEnd();

Even though I have enabled light and glCololMaterial(), still I can not see the light effect, any hints?

rgpc
07-30-2003, 06:35 PM
1 This is not an advanced topic.

2 Typically you would use glMaterial()

3 How do you set up your lighting? Do you actually call glEnable(GL_LIGHTING)?

4 Have you looked at any of the 14 Billion tutorials available on the Web?

JanHH
07-31-2003, 08:04 PM
OpenGL does not support light and colour at the same time.

harsman
07-31-2003, 11:56 PM
Yes it does. Where'd you get the idea that you cant use color and lighting at the same time? Look up GL_COLOR_MATERIAL.

JanHH
08-01-2003, 06:35 AM
hm you were really assuming that I was NOT joking?