PDA

View Full Version : triangles in vertex array



rilestyle
12-24-2003, 09:47 AM
Hi I have a vertex array in which I need to specify the color attribute only every 3 vertexes (once for every triangle) but I can't figure out a way to do this.

It seems like interleaved arrays and calling drawarrays always wants matching array sizes depending on a vertex count, however, it seems like using 12 color values for each triangle rather than 4 is rather inefficient.

Ostsol
12-24-2003, 12:53 PM
There's no way you can specify this in your data. However, you can tell OpenGL to use only a single colour for the entire quad or triangle via glShadeModel (GL_FLAT).