i have a display list that displays a terrain. now i also have a colorscale that assigns different colors for different heights. is there any way that i can color the whole display list with a new colorscale without having to generate a new list.
pseudo code :
glColor() sets a color. If the list doesn’t re-set the color, then a call to glColor() will set the incoming vertex color (or color material) that’s active when the list geometry gets drawn.
What you want to do is probably to use more than one color, for different heights, at the same time. You can do this by sticking the color ramp into a 1 pixel tall, N pixels wide texture, and using GL_S OBJECT_LINEAR texgen. Set the texgen plane to the Y vector scaled by the inverse of the height if your field.
More details available under OBJECT_LINEAR in the red book, or the freely downloadable OpenGL specification PDF (available on the front page of this site).
Originally posted by jwatte:
Set the texgen plane to the Y vector scaled by the inverse of the height if your field.
could u plz elaborate on this. its a little too much for me to follow.
herez a link to a snapshot of my problem