Archived

This topic is now archived and is closed to further replies.

Pure White? I wanted a shade of Green...

This topic is 5114 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I''m using 2D Ortho view, and I''m trying to draw a quad. But it always turns out white. With the colours I''ve put in there, I was expecting a full green with a little shade of red and blue tossed in for some variety. But the quad comes up a perfect bright shade of white. Can anyone fill me in? glLoadIdentity(); glTranslatef((float)320, (float)240, 0.0f); glBegin(GL_QUADS); glColor3d(24, 255, 24); glVertex2d(-16, 16); glVertex2d( 16, 16); glVertex2d( 16,-16); glVertex2d(-16,-16); glEnd();

Share this post


Link to post
Share on other sites
You can have
glColor 3/4 f/d/b/ub

(stands for float/double/byte/unsigned byte)

The 3 and 4 are the number of values entered in, being RGB or RGBA respectively.
Have I forgotten anything?

[edited by - strider44 on December 16, 2003 8:46:37 AM]

Share this post


Link to post
Share on other sites
I think the full set of color commands is:

void glColor3{b s i f d ub us ui} (TYPEr, TYPEg, TYPEb);
void glColor4{b s i f d ub us ui} (TYPEr, TYPEg, TYPEb, TYPEa);
void glColor3{b s i f d ub us ui}v (const TYPE*v);
void glColor4{b s i f d ub us ui}v (const TYPE*v);
void Color3hNV(half red, half green, half blue);
void Color3hvNV(const half *v);
void Color4hNV(half red, half green, half blue, half alpha);
void Color4hvNV(const half *v);

for more details see the redbook and the GL_NV_half_float extension specification.

Enigma

Share this post


Link to post
Share on other sites