Public Group

# thermal mapping with openGL

This topic is 3837 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I've read a few intro. tutorial on OpenGL, and understand the basics, and was wondering if anybody could shed some light on how to implement this problem with it: If we have a pixel matrix, with each pixel representing a different "heat content" of a thermal map, then we could represent the matrix according to some "heat-coloring scheme": 01 = Violet (very cold) 02 = Blue (chilly) 03 = Yellow (mild) 04 = Orange (hot) 05 = Red (very hot) And thus, a 1x9 (R x C) pixel matrix of (02 03 03 04 05 04 03 02 01) would represent a thermal map of pixels of colors (B Y Y O R O Y B V); just try to imagine these colors in a row sequence. Essentially my program will output a large matrix of these types of integers, which will be converted to colors, thus producing a thermal map. (1) Can OpenGL be used to display this map? (2) If so, how? Else, why not?

##### Share on other sites
Quote:
 Original post by plywood(1) Can OpenGL be used to display this map?

Yes.

Quote:
 (2) If so, how?

Either convert your map into properly colored texture, and slap that onto a rectangle, or let your map pixels be vertices, assign colors to them, and connect them into a grid.

##### Share on other sites
1) Yes.
2) There are a variety of options. The simplest way would probably be to simply convert the [n][n] matrix into a [n*n*3] matrix with the appropriate RGB values and load them into a texture with glTexImage2d. That texture can then be displayed on a surface, such as a quad covering the screen.

• ### What is your GameDev Story?

In 2019 we are celebrating 20 years of GameDev.net! Share your GameDev Story with us.

(You must login to your GameDev.net account.)

• 17
• 14
• 10
• 9
• 11
• ### Forum Statistics

• Total Topics
634094
• Total Posts
3015498
×