I have the following code in OpenGL and I want to make a specific drawing
void Render()
{
glClear(GL_COLOR_BUFFER_BIT ); // Clean up the colour of the window
// and the depth buffer
glTranslatef(0,-30,0);
glRotatef(80,1,0,0);
glColor3f(0.5, 0.5, 1.0);
GLUquadricObj *p = gluNewQuadric();
gluQuadricDrawStyle(p,GLU_FILL);
gluCylinder(p, 40.0, 40.0, 7.0, 1000, 100);
glColor3f(1.0, 1.0, 1.0);
glScalef(40,40,40);
Circle();
glMatrixMode(GL_MODELVIEW);
glLoadIdentity(); //loading identity table
}
You can easily see that I draw a cylinder with a circle just over it. What I want to do is draw another cylinder of different size just above the already drawn shape. I tried to use the same code to draw the next cylinder, but it appears below…and when I try to translate the first shape and put it lower it seems the glTranslate(); command has no effect !!!
What should I do?