View Full Version : How to draw a cylinder

03-30-2010, 05:32 AM
i am a total beginner in opengl

i have a code to draw a cylinder:

gl.glColor3d(1.0, 0.0, 0.0);
glu.gluCylinder(gluQuadric, 1, 1, 3, 20, 20);

how can i indicate the start and end (x, y, z) coordinates of the cylinder?

any help is greatly appreciated
thanks in advance

03-30-2010, 07:24 AM
If you want to use gluCylinder, this function creates a cylinder along the positive z axis. It starts from z=0.0 and up to your height value, which is 3.

To position it however, you want use the modelview matrix (glTranslatef)