I have written a small program that displays a heat-map of roughly 1024X1024 pixels which lie on the surface of a sphere.
Each pixel is a Quad.
The vertices as well as the Colors are stored in a VBO (vc_VBO).
A separate Index VBO is used to draw the Quads.
The draw code looks like this:
self.vc_VBO.bind()
self.index_VBO.bind()
gl.glEnableClientState(gl.GL_VERTEX_ARRAY)
gl.glEnableClientState(gl.GL_COLOR_ARRAY)
gl.glColorPointer(4, gl.GL_FLOAT, 28, self.vc_VBO+12)
gl.glVertexPointer(3, gl.GL_FLOAT, 28, self.vc_VBO)
gl.glDrawElements(gl.GL_QUADS, len(self._indices), gl.GL_UNSIGNED_INT, None)
The problem I have is that I want each Quad to have a uniform(i.e. constant) color which is defined by the color of its upper left vertice, how can I achieve this ?
Am I on the right track or should I do things completely different ?
Here is a sample picture of how the program looks,right now: image