
Originally Posted by
newsb
# glPush + some translation + rotation....
# Enable blending / transparancy
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
# Cylinder color (NB: ALPHA MUST BE < 1, DEFAULT IS 0.5)!
glColor4f(1.0, 1.0, 1.0, 0.2)
# Draw ends of cylinder:
cyl_obj = gluNewQuadric();
cylHgt = 0.2
glTranslate( 0.0, 0.0, -cylHgt/2 )
# Draw cylinder:
# gluDisk (GLUquadricObj, innerRadius, outerRadius, slices, rings)
gluDisk(cyl_obj, 0.0, 0.1, 12, 1);
# gluCylinder(gluNewQuadr, Radius_base, Radius_top,
# height, slices, stacks)
gluCylinder(cyl_obj, 0.1, 0.1, cylHgt, 12, 1);
glTranslate( 0.0, 0.0, cylHgt )
gluDisk(cyl_obj, 0.0, 0.1, 12, 1);
glPopMatrix() # -- POP PROJECTION MATRIX