light

I am messing around with the lighting chapter of The OpenGL Programming Guide and was wondering how do you change the ambient light to reflect the color of the object.

GLfloat ambient[]={1.0,0.0,1.0,1.0};
...
glLightfv(GL_LIGHT0,GL_AMBIENT,ambient);
...
glEnable(GL_AMBIENT);

But how would you do it on a smooth shaded multi-colored polygon?

look into glMaterialfv
and enable GL_COLOR_MATERIAL.

Thanx man works like a charm