Thread: opengl color problem

  1. #1
    Registered User Zeeshan's Avatar
    Join Date
    Oct 2001
    Location
    London, United Kingdom
    Posts
    226

    Angry opengl color problem

    Hey,

    In my program I'm drawing a square on the x-z plane RED in colour.

    But, it appears MULTI-COLORED...

    The drawing code is ...
    angle+=1.0f;
    glClear (GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    glLoadIdentity (); glTranslatef (0.0f, 0.0f, -5.0f);
    glRotatef(angle,1.0f,0.0f,0.0f);
    glBegin(GL_QUADS);
    glColor3f(1.0f,0.0f,0.0f); glVertex3f(0.0f,0.0f,0.0f);
    glColor3f(1.0f,0.0f,0.0f); glVertex3f(GROUND,0.0f,0.0f);
    glColor3f(1.0f,0.0f,0.0f); glVertex3f(GROUND,0.0f,-GROUND);
    glColor3f(1.0f,0.0f,0.0f); glVertex3f(0.0f,0.0f,-GROUND);
    glEnd();

    To see what's happening plz download (only executable)
    Last edited by Zeeshan; 06-13-2002 at 10:42 PM.

  2. #2
    Has a Masters in B.S.
    Join Date
    Aug 2001
    Posts
    2,263
    define MULTI-COLORED... like red and blue, or blue red and yellow, or different shades of red?
    ADVISORY: This users posts are rated CP-MA, for Mature Audiences only.

  3. #3
    Registered User Coder's Avatar
    Join Date
    Aug 2001
    Location
    Cairo, Egypt
    Posts
    128
    Are there any lights enabled? Lights can alter your colors
    Muhammad Haggag

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Linking OpenGL in Dev-C++
    By linkofazeroth in forum Game Programming
    Replies: 4
    Last Post: 09-13-2005, 10:17 AM
  2. OpenGL Window
    By Morgul in forum Game Programming
    Replies: 1
    Last Post: 05-15-2005, 12:34 PM
  3. OpenGL .dll vs video card dll
    By Silvercord in forum Game Programming
    Replies: 14
    Last Post: 02-12-2003, 07:57 PM
  4. OpenGL and Windows
    By sean345 in forum Game Programming
    Replies: 5
    Last Post: 06-24-2002, 10:14 PM
  5. opengl code not working
    By Unregistered in forum Windows Programming
    Replies: 4
    Last Post: 02-14-2002, 10:01 PM