Jump to content
  • Advertisement

Archived

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

Estauns

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

This topic is 5330 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
Advertisement
1 is the max number you have to have to get that full color and 0 for black. change it to something like glColor3d(0.2f, 1.0f, 0.2f);

---------------------------
The pipes clangor all the time.

Share this post


Link to post
Share on other sites
glColor3d -> d is for deouble not for decimal
read redbook for function post-fixes description

You should never let your fears become the boundaries of your dreams.

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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!