I drew this truncated isocohedron where only pentagons are faces, everything else is just wireframe. Now I want these polygons to be lit from both sides by different light sources. This is what I’ve done:
GL11.glLightModeli (GL11.GL_LIGHT_MODEL_TWO_SIDE, 17);
FloatBuffer position1 = BufferUtils.createFloatBuffer (4).put (new float[] {0, 0, 0, 1});
position1.flip ();
GL11.glLight (GL11.GL_LIGHT0, GL11.GL_POSITION, position1);
GL11.glColorMaterial (GL11.GL_FRONT_AND_BACK, GL11.GL_DIFFUSE);
GL11.glColor3d (0, 1, 1);
normale = normale (2 + fi, 2 * fi, 1,
2, 1 + 2 * fi, fi,
1, 3 * fi, 0);
GL11.glNormal3d (normale[0], normale[1], normale[2]);
GL11.glBegin (GL11.GL_POLYGON);
GL11.glVertex3d (1, 3 * fi, 0);
GL11.glVertex3d (2, 1 + 2 * fi, fi);
GL11.glVertex3d (2 + fi, 2 * fi, 1);
GL11.glVertex3d (2 + fi, 2 * fi, -1);
GL11.glVertex3d (2, 1 + 2 * fi, -fi);
GL11.glEnd ();
By the way, it is in Java I only show how I draw a single polygon of my football, the lighting source is at the center of it. Every one of two polygons that are on opposite sides are lit incorrectly. For instance the mirror image of this polygon on X axis is lit how it should be. This one, on the other hand, has his outer side visible, not inner. I know the order of vertices is different in my program, that’s why I specify normal vector for each polygon. I checked, these vectors are calculated correctly.
What am I doing wrong?