PDA

View Full Version : Drawing 3D heatmap surface based a set of vertices



oumind
10-28-2008, 02:42 AM
I would like to draw a 3D heat map (http://en.wikipedia.org/wiki/Heat_map) surface based a set of vertices. Since I am a newbie in 3D and OpenGL programming, please verify my solution
1. To draw the 3D surface, draw a series of triangles (GL_TRIANGLE_STRIP) by specifying a number of 3D vertices. Smoothing is not required.
2. For heat map, change the color of a vertex based on z value.


Thank you.

Y-tension
10-28-2008, 06:54 AM
Or you could even put the heatmap on a texture and draw a quad with the texture on it.

Duncan Champney
10-28-2008, 12:51 PM
I would like to draw a 3D heat map (http://en.wikipedia.org/wiki/Heat_map) surface based a set of vertices. Since I am a newbie in 3D and OpenGL programming, please verify my solution
1. To draw the 3D surface, draw a series of triangles (GL_TRIANGLE_STRIP) by specifying a number of 3D vertices. Smoothing is not required.
2. For heat map, change the color of a vertex based on z value.


Thank you.

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:


ChromaDepth paper (http://web.engr.oregonstate.edu/~mjb/chromadepth/chromapaper.pdf)

oumind
10-28-2008, 05:28 PM
Y-tension and Duncan Champney, thank you for your reply