PDA

View Full Version : Lighting.



dmantamp
02-26-2004, 08:42 PM
Hi all,
How to get lighting effect with the colors that I used to draw the objects. That is I have a cube with diferent colors for each surface. But When I use lighting effect. I get all in white-black-grey combination. I used white light( {1.0,1.0,1.0,1.0}). I tried some of the examples from the net. But didn't help. Can anybody help me. So that I get the surfaces lit with its own colors.

mikael_aronsson
02-26-2004, 10:53 PM
Hi !

Maybe you could post the part of your code that does the rendering here, it is difficult to say whats wrong without having a peek at the code.

Mikael

Nychold
02-27-2004, 06:53 AM
When you apply lighting, the colored vertices will disappear. Don't know why, but they do. In order to get them back, you either have to create a texture, or use materials. Setting the material values is usually easier. XD

gvm
02-27-2004, 06:58 AM
did you try to search about this here?
use this:
glEnable(GL_COLOR_MATERIAL);
if u use glColor3f to color vertices
or use materials....

[This message has been edited by gvm (edited 02-27-2004).]