PDA

View Full Version : Drawing a cylinder



Dracolysk
07-22-2001, 08: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!

zed
07-22-2001, 03:52 PM
draw a 2d circle eg with sin+cos + just give it some height

mikael_aronsson
07-22-2001, 10:27 PM
Download Mesa
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

element
07-25-2001, 02: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).]

Dracolysk
07-28-2001, 10:37 AM
Thanks everyone! I got it...appreciate the help!

MrShoe
07-29-2001, 09:27 PM
maybe instead of glutCylinder try the glu version... Quadrics....