I have code that creates a few display lists. I call a few display lists, then when I call the other to draw a tree, it is drawn with a color set in the previous display list.
This is strange… And I am changing the color in the tree’s display list. This is what doesn’t work:
glColor3f(0.4f, 0.3f, 0.1f);
glBegin (GL_TRIANGLES);
for(i=0 up to i=lots of triangles){
//draw a triangle
}
glEnd(GL_TRIANGLES);
but, when I shove the glColor3f inside the for loop so that the color gets set every triangle, it works fine:
glBegin (GL_TRIANGLES);
for(i=0 up to i=lots of triangles){
glColor3f(0.4f, 0.3f, 0.1f);
//draw a triangle
}
glEnd(GL_TRIANGLES);
This is really bothering me, because I don’t understand why this would happen. Please, any help?