PDA

View Full Version : Lighting



Fernando
08-28-2002, 05:45 PM
Have you guys already tryied to add lighting to objects that doesn't have a texture? I'm trying to do this, and it's almost working. I would like to be able to change the object color, but I added a glColor3f(withacolor), and the object don't change it's color. It is receiving the lighting, but the color don't change.

Maybe I'm doing something wrong.

Do you know what kind of problem I'm having?

Thank you
Fernando

SThomas
08-28-2002, 08:07 PM
yeah, when you're using lighting, you need to use material properties instead of colors.

look up the glMaterial*() functions.

nexusone
08-29-2002, 03:51 AM
Make sure that you use:
glEnable(GL_COLOR_MATERIAL);
when using lighting.



Originally posted by Fernando:
Have you guys already tryied to add lighting to objects that doesn't have a texture? I'm trying to do this, and it's almost working. I would like to be able to change the object color, but I added a glColor3f(withacolor), and the object don't change it's color. It is receiving the lighting, but the color don't change.

Maybe I'm doing something wrong.

Do you know what kind of problem I'm having?

Thank you
Fernando