1. ## Drawing a cylinder

I have used the gluCylinder function, but was wondering if there was source code available somewhere that draws a cylinder in OpenGL using the OpenGL primatives. Any suggestions would be appreciated, thanks!

2. ## Re: Drawing a cylinder

draw a 2d circle eg with sin+cos + just give it some height

3. ## Re: Drawing a cylinder

http://sourceforge.net/projects/mesa3d/

All the source code is included, so you can have a look at all the source code including gluCylinder.

Mikael

4. ## Re: Drawing a cylinder

I think what I would do is first decide how many sides you want it to have, 6 sides 8, 10,100? Then draw 2 flat polygons with that many sides, those will be the top and bottom (for a solid cylinder). Next draw quads from each top vertex to its corresponding bottom vertex. Continue all around and there is your cylinder.

Not sure if this would work let us know how it goes.

[This message has been edited by element (edited 07-27-2001).]

5. ## Re: Drawing a cylinder

Thanks everyone! I got it...appreciate the help!