Coloring Polygon Face using glDrawElements
Please Help,
I am new to JOGL VBOs and am having some difficulty coloring shared vertices - I really need to color by polygon face. For example I have a file of triangles that are connected and as such will have some shared vertices. Example file:
TRIANGLES:
Tri1 vert1 vert2 vert3 color_red
Tri2 vert3 vert2 vert4 color_blue
...
VERTICES:
vert1 X-coord Y-coord Z-coord
vert2 X-coord Y-coord Z-coord
...
So, the "shared" vertex (vert2 and vert3) are both Red and Blue so how can this be done with JOGL using glDrawElements and glColorPointer. I know that I should make copies of the shared vertices to properly display the colors using the glDrawElements() and glColorPointer() but am unsure of the correct execution.
Can I just append the newly duplicated, shared nodes to the already existing Color and vertex arrays? Do I also need to append a new indice for the array being passed to the glDrawElements()? It seems that I should also have a duplicate polygon indice to render the polygon with the duplicate node also but I don't know if this is the case.
Any hints/help or some simple and quick pseudo-code would be great. Like I said, I am a newbie with regards to JOGL VBOs.
Thanks in advance.
Message was edited by:
pooh145

