Hi. I understand your idea. I also enable glColorMaterial for the correct visualization of the colors, but thats not my problem. I have no problem with lights or normals.
When I call glDrawElements, all my pointers are filled with the correct data, vertexes, normals and faces are rendered as I want. But the function glColorPointer seems not to take the information of the pointer and it’s only paint the front face of my cube with red and the rare face with blue. The others faces are painted with a gradient of red and blue. In a few words, it’s ignore all the pointer and I don’t know why. I will include the definition of my pointers. Maybe this helps to understand the problem.
FaceList : Array [0…35] Of GLInt =
(0, 2, 3, 0, 1, 2, // Face 0 - front
0, 3, 5, 0, 5, 4, // Face 1 - right
4, 5, 6, 4, 6, 7,
7, 6, 2, 7, 2, 1,
1, 0, 7, 0, 4, 7,
3, 2, 6, 6, 5, 3);
VertexList : Array [0…23] Of GLFloat =
( 1.0, 1.0, 1.0, { Vertex 0 }
-1.0, 1.0, 1.0, { Vertex 1 }
-1.0, -1.0, 1.0, { Vertex 2 }
1.0, -1.0, 1.0, { Vertex 3 }
1.0, 1.0, -1.0, { Vertex 4 }
1.0, -1.0, -1.0, { Vertex 5 }
-1.0, -1.0, -1.0, { Vertex 6 }
-1.0, 1.0, -1.0); { Vertex 7 }
NormalList : Array [0…17] Of GLFloat =
( 0.0, 0.0, 1.0, { Face 0 }
1.0, 0.0, 0.0, { Face 1 }
-1.0, 0.0, 0.0, { Face 2 }
0.0, 1.0, 0.0, { Face 3 }
0.0, -1.0, 0.0, { Face 4 }
0.0, 0.0, -1.0); { Face 5 }
PColorList : Array [0…95] Of GLFloat =
(1.0, 0.0, 0.0, 1.0,
1.0, 0.0, 0.0, 1.0,
1.0, 0.0, 0.0, 1.0,
1.0, 0.0, 0.0, 1.0,
1.0, 0.0, 1.0, 1.0,
1.0, 0.0, 1.0, 1.0,
1.0, 0.0, 1.0, 1.0,
1.0, 0.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 0.0, 1.0, 1.0,
1.0, 0.0, 1.0, 1.0,
1.0, 0.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0,
1.0, 1.0, 1.0, 1.0);
It don’t matter haw many elements I put or how many colors y change. glColorArray ignore it all. Thanx for answer. Bye.