Hi,
I had asked earlier this month about animation in OpenGL and the animation that I produced is in grayscale. The problem seems to be that I don’t have RGB values for the images just single integers from 0 to 255 that I put into the RGB array. I thought of using color-index mapping but I’m at a loss on how to generate a lookup table. Is it that OpenGL has its own internal lookup table or I can specify mine. If I could specify my own color map, how do I implement this ( I am thinking of using the glIndex function).
Hi,
Thanks for your reply but I have a different problem. I have an image which can be expressed as a 296x128 pixel array. This represents a density map and there is only one value of the density per pixel( so to speak). Please see the topic in this forum ‘Animation using OpenGL’ by Otonski.
My solution was to give the same density value to the RGB array ie red = 255, green = 255, blue = 255. That produced the grayscale image( notice they are integers). I thought using a color map where a number say 202 generates an RGB triplet may be the solution to making a color image.
Originally posted by Otonski: Please see the topic in this forum ‘Animation using OpenGL’ by Otonski.
So you are saying that you don’t want a monochrome image but a colormap which holds the “density” of the image. I think this can’t be done easily from the image. You must preprocess your data, then use it with OpenGL
Originally posted by Azdo: You must preprocess your data, then use it with OpenGL
You can, for example, set the range of all your values between 0 and 0x00FFFFFF by dividing all your values by 255, then multiplying them by 0x00FFFFFF. The purpose is to have the RGB values of the colour. If red and green values are zero, then use only the blue value: