I want to draw two discs in red color using openGL. I am able to draw the discs but no matter what color I specify for the discs, one turns out to be blue and the other black.
I tried retrieving the color through "glGetFloatv(GL_CURRENT_COLOR, gf);" and the color is correctly specified, but still the drawing is always in blue and black.
below is the code snippet. My application is based in clockwise drawing
glEnable( GL_LIGHTING ); glEnable( GL_LIGHT0 ); glEnable(GL_DEPTH_TEST); glEnable(GL_CULL_FACE); glFrontFace(GL_CW); glEnable( GL_DEPTH ); glShadeModel( GL_SMOOTH );
code to draw discs
GLUquadricObj* quadraticObject = gluNewQuadric( ); glTranslatef(0.0,0.0,-250.0); glColor4f(1.0,0.0,0.0,1.0); GLfloat gf; glGetFloatv(GL_CURRENT_COLOR, gf); gluDisk(quadraticObject, 0.0, 50.0, 100, 100); glTranslatef(0.0,0.0,500.0); gluDisk(quadraticObject, 0.0, 50.0, 100, 100);
first disc blue and the second one is black :(