I have a problem in back surface coloring.
I give two different colors (red front, white back) to the surfaces.
I draw a triangle on the screen. When I rotate that triangle I realized that front and back surfaces have same colors.
My coloring code for front and back surfaces is below:
glMaterialfv(GL_FRONT, GL_AMBIENT, mat_ambient);
glMaterialfv(GL_FRONT, GL_DIFFUSE, mat_diffuse2);
glMaterialfv(GL_FRONT, GL_SPECULAR, mat_specular2);
glMaterialfv(GL_BACK, GL_AMBIENT, mat_ambient);
glMaterialfv(GL_BACK, GL_DIFFUSE, mat_diffuse1);
glMaterialfv(GL_BACK, GL_SPECULAR, mat_specular1);
I used two light sources in z and -z directions.
Would you please tell me what the problem can be?