Advertisement

Draw a cone

Started by November 16, 2000 09:36 AM
4 comments, last by ogl 24 years ago
Hi I would like to draw a cone (wire-frame as well as solid) how do I do this?
MY GUESS on drawing a cone flat on the x-z plane

get an x,z coordinate and y (height) and radius

from the x,z draw a circle based on the radius.
then as you are drawing the circle say every n degrees (we''ll say 10 for this example draw a line from that point on the edge of the circle to the x,z,y (HEIGHT) point. once you have this you need to draw triangles between specified point on the lines you drew from the points on the circle to the x,y,z points.

If you draw a line for every 1 degree you will have a VERY high res cone..


my guess and this would theoretically work..






Advertisement
Doesn''t GLU provide a function for cylinders where U can specify each raduis of the ends???

--Ched--
chris@ched45.com
--Ched--chris@ched45.com
There is a gluCylinder function - I don''t know how to specify its parameter

Any example - cheers
In Lesson 18 of NeHe's tutorials, there is a perfect example of how to make a cone. Enjoy!!! (oops--originally had "cylinder" in here, not "cone.")
Code snippets below....

***Explanation directly from Lesson 18***
"Our fifth object is created using the same command that we used to create a Cylinder. If you remember, when we were creating the Cylinder the first two parameters controlled the radius of the cylinder at the bottom and the top. To make a cone it makes sense that all we'd have to do is make the radius at one end Zero. This will create a point at one end. So in the code below, we make the radius at the top of the cylinder equal zero. This creates our point, which also creates our cone."

****The following declaration is a global****

GLUquadricObj *quadratic; // Storage For Our Quadratic Objects

***The call to make the cylinder(or cone, as is this case) follows****

gluCylinder(quadratic,1.0f,0.0f,3.0f,32,32)

Make sure to search through NeHe's tutorials often; he typically has the answers to a lot of questions seen on the board!

Hope this helps!

--David

Edited by - Sakairu on November 17, 2000 2:08:33 PM
Cheers I''ll try that

This topic is closed to new replies.

Advertisement