why can't I get green?

I have the following code as part of my program. It seems to me that it should be drawing in green, not red, but it draws in red. To save space I have only included my display function.
Here it is:

void displayFunc(void)


gluLookAt(0.0, 0.0, 19.0,
0.0, 0.0, 0.0,
0.0, 1.0, 0.);

glColor3f(0.0f, 1.0f, 0.0f);


 glNormal3f( 0.0f, 0.0f, 1.0f);	 
 glVertex3f( -3.0f, 0.0f, 0.5f);
 glVertex3f( -3.0f, 1.0f, 0.5f);
 glVertex3f( -2.0f, 1.0f, 0.5f); 
 glVertex3f( -2.0f, 0.0f, 0.5f);
 glNormal3f( 0.0f, 0.0f, 1.0f);
 glVertex3f( -2.0f, 1.0f, 0.5f);
 glVertex3f( -2.0f, 0.0f, 0.5f);
 glVertex3f( -1.0f, 0.0f, 0.5f);
 glVertex3f( -1.0f, 1.0f, 0.5f);




See the answers given to Sajjad (color differences) who has the same problem.
In your case, I would be agree with Zed.
(mode GRB)

Ummm, color me stupid but… Shouldn’t the glColor3f() call be inside of the glBegin()/glEnd() pair??? And whats this talk of grb??? I’ll have to check out that thread… but any OpenGL implementation that conformed to the OpenGL standard would properly convert values passed to glColor() to the device dependant format…

Ok, I just checked that other thread and it has nothing to do with this issue. Sorry Pip That issue is dealing with textures being read in from a disk file and the file possibly storing the pixel data in the wrong format (well, not wrong, just different). This is obviously not the case here.

BwB: glColor can be called at any time, inside or outside a glBegin/glEnd pair.

You have right about the talk BWB.

But no matter when glColor is called. (After or before a glBegin)
It is just important to call it before glVertex, in this example.
The color is a simple Status.
There is something wrong, somewhere

The display function alone is not sufficient to derive the OpenGL state from it.
If you have, for example, enabled lighting and disabled color material, then the glColor call is just obsolete.

Are textures enabled/bound? That could cause it to be a different color as well.

i agree with relic + deiussum, in times of trouble disable everything eg lighting,textures,blending, alphatest etc.
then it should work. then enable them one at a time to find the culprit.