PDA

View Full Version : drawing cone and cylinder



09-25-2000, 10:52 PM
hi to all of u..

i m doing my final project now, and i really REALLY want to know how to draw cone and cylinder using openGL..i hope all of u here can help me...

thanks http://www.opengl.org/discussion_boards/ubb/smile.gif

Gavin
09-26-2000, 01:36 AM
So do you want to know how to get opengl to work or just the algorithm for cone and cylinder?

gav

09-26-2000, 04:34 AM
yup...i want to know how get opengl to work on those cones and cylinders..

Bob
09-26-2000, 06:07 AM
gluCylinder will do the job for you.




GLUquadricObj *quadObj = gluNewQuadric();
gluCylinder(quadObj, base, top, height, slices, stacks);

i think.
base=base radius
top=top radius

09-26-2000, 07:56 AM
thanks...but what about the cone?

Bob
09-27-2000, 12:54 AM
Uhmm... thought you could figure that out http://www.opengl.org/discussion_boards/ubb/tongue.gif

A cone is a cylinder with top (or bottom if you want the cone "up side down") radius set to zero.

[This message has been edited by Bob (edited 09-27-2000).]

Aerandir
02-15-2012, 05:06 AM
I would like to draw a so-called-cylinder but the base and top are not parallel. Any ideas if there is such a function or do I need to hardcode it. If so, how?

BionicBytes
02-15-2012, 05:34 AM
I would like to draw a so-called-cylinder but the base and top are not parallel
A gluCylinder most certain is! Are you sure you have not just rotated the model with a viewing transform or something?

freemancw
08-16-2012, 11:30 PM
Wrote an article describing how to draw a cone without using GLU/GLUT, would be happy to know if there are errors!

http://www.freemancw.com/2012/06/opengl-cone-function/