I am trying to use the glDrawElements() with glColorPointer() set to "color" elements/faces and not the individual vertices. Does anybody know if this is possible and if so, please help.
For example, I have an ASCII file that has a section with X, Y, Z coordinates and Elements/face section with point/nodal connectivity. such that:
Node1 X_coord Y_coord Z_coord
Node2 X_coord Y_coord Z_coord
Element1 Node1 Node2 Node3 Element1_color
Element2 Node3 Node4 Node5 Element2_color
I have been setting the GLfloat colors array using R, G, B but it looks like the colors are determined on the vertices/nodes and not for the element/face which is what I would like.
Any help/hints would be great.