I would like to draw a 3D heat map (Heat map - Wikipedia) surface based a set of vertices. Since I am a newbie in 3D and OpenGL programming, please verify my solution
To draw the 3D surface, draw a series of triangles (GL_TRIANGLE_STRIP) by specifying a number of 3D vertices. Smoothing is not required.
For heat map, change the color of a vertex based on z value.
So you want both the height and the color of each vertex to vary based on your data value?
You have a number of choices.
You could recreate your 3D object each time you draw it, and specify the z value and the color varying both based on your input data.
You could also create you 3D image using your input value as the z value, as you have said. You could then create a one dimensional texture that maps height values to color values, using glTexGen.
I haven’t done this yet, but I recently read a paper on something called ChromaDepth that spells out in some detail how to do this. See this link for more information: