kraeste
05-22-2011, 08:00 AM
hello there!
my vertex data (position and norms) is currently stored in a GL_ARRAY_BUFFER_ARB. the vertex ids (3 ids for one triangle) are hold in a GL_ELEMENT_ARRAY_BUFFER_ARB. The scene is drawn with glDrawElements().
I now want to draw whole triangles (not single vertices!) in different RGBA colors. I've read about glColorPointer() but this seems to work only for coloring single vertices. Since the triangles share vertices this isn't possible for me.
The scene I'm drawing is quite large, so I'd like to stick to my vertex buffer objects if possible.
Maybe someone here can suggest a solution. That would be really nice.
Cheers!
my vertex data (position and norms) is currently stored in a GL_ARRAY_BUFFER_ARB. the vertex ids (3 ids for one triangle) are hold in a GL_ELEMENT_ARRAY_BUFFER_ARB. The scene is drawn with glDrawElements().
I now want to draw whole triangles (not single vertices!) in different RGBA colors. I've read about glColorPointer() but this seems to work only for coloring single vertices. Since the triangles share vertices this isn't possible for me.
The scene I'm drawing is quite large, so I'd like to stick to my vertex buffer objects if possible.
Maybe someone here can suggest a solution. That would be really nice.
Cheers!