void MyCylinder::draw() { GLUquadricObj *Cylinder1 = gluNewQuadric(); glPushMatrix(); gluCylinder(Cylinder1, 3.0, 3.0, 10.0, 32, 5); glPopMatrix(); glPushMatrix(); DrawCircleArea(0.0, 0.0, 10.0, 3.0, 32);//top DrawCircleArea(0.0, 0.0, 0.0, 3.0, 32);//base glPopMatrix(); }
void mySolidCylinder(GLUquadric* quad, GLdouble base, GLdouble top, GLdouble height, GLint slices, GLint stacks) { glColor3f(84.0 / 255, 0.0, 125.0 / 255.0); gluCylinder(quad, base, top, height, slices, stacks); //top DrawCircleArea(0.0, 0.0, height, top, slices); //base DrawCircleArea(0.0, 0.0, 0.0, base, slices); }