PDA

View Full Version : glColor*();



Hylke Donker
12-23-2004, 06:41 AM
Hello
I want to make a grey box, when the users quits, but i can't same to set the color to grey, it stays in the color blue.

if(draw_quit_scene)
{
glColor3f(0.5, 0.5, 0.5);
glBegin(GL_QUADS);
glVertex3f(-0.5, -0.5, -1.0);
glVertex3f(-0.5, 0.5, -1.0);
glVertex3f(0.5, 0.5, -1.0);
glVertex3f(0.5, -0.5, -1.0);
glEnd();
...
...
} That is my code that should draw a gray box, but instead of drawing a gray box it draws a blue box.
Anyone an idea what the problem could be?
Thanx Hylke

iznogoud
12-23-2004, 07:10 AM
I suspect that it is the lighting and choice of
shading method that are giving your trouble. You
are simply drawing a polygon in world coordinates,
which, apparently, goes through the regular pipeline
that all polygons in your 3D game go through.

Without clearing the colour buffer, issue calls for
flat shading and no real lighting (change the state)
and then draw the box. Kind of line the very first
example in the redbook.

This might not be what you want, but it is justa thought.

Hylke Donker
12-23-2004, 09:34 AM
Thank you for your reply.
That was the problem.
Hylke