View Full Version : Drawing a cylinder
07-22-2001, 09:25 AM
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!
draw a 2d circle eg with sin+cos + just give it some height
07-22-2001, 11:27 PM
All the source code is included, so you can have a look at all the source code including gluCylinder.
07-25-2001, 03:44 PM
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).]
07-28-2001, 11:37 AM
Thanks everyone! I got it...appreciate the help!
07-29-2001, 10:27 PM
maybe instead of glutCylinder try the glu version... Quadrics....
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.