lighting back and front

hi,
i want to light my objects back and front.
her is my pseudo-code :

glPolygonMode(GL_FRONT_AND_BACK , GL_FILL);
glColorMaterial (GL_FRONT, GL_AMBIENT_AND_DIFFUSE);
glColor4fv(color1) ;
glColorMaterial (GL_BACK, GL_AMBIENT_AND_DIFFUSE);
glColor4fv(color2) ;

i don’t have the desired effect. can anybody tell me why?
moreover, do i have to specify normals again but in an opposite direction ?

thanks ! : )

Did you do

  • glEnable(GL_COLOR_MATERIAL)?
  • glLightModeli(GL_LIGHT_MODEL_TWO_SIDE, 1)?

BTW, if this is the only place where you specify the material, better use glMaterial call directly instead of enabling color material.

[This message has been edited by Relic (edited 06-06-2001).]