How to create a solid cone

Nov 24, 2014 at 8:11 AM
How to draw solid cone with specific height using SharpGL?
Nov 24, 2014 at 7:33 PM
To make a Cone:

You can use gl.Cylinder( IntPtr, baseRadius, topRadius, height, slices, stackes);
https://www.opengl.org/sdk/docs/man2/xhtml/gluCylinder.xml
IntPtr i = new IntPtr();
i = gl.NewQuadric();
gl.QuadricNormals(i, OpenGL.GL_SMOOTH);
gl.Cylinder(i, 0, 2, 8, 120, 16);
Note:
I think, Cylinder is likely to use deprecated code (OpenGL 3.0 changed 2008/2009 to use vertex arrays for drawing).
Cylinder I believe, is part of GLUT utility toolkit that I believe uses depreciated OpenGL commands http://en.wikipedia.org/wiki/OpenGL_Utility_Toolkit.
I would still use this if I could easily change the code if required (used within my company or personal use or update customers code easily).
I guess what will happen at some stage, newer graphic cards will stop supporting OpenGL deprecated code.
Somebody please comment if I'm wrong on any of this (or if correct)!

To draw using Modern OpenGL you would use Vertex Array Object (VAO and VBO)
I would google "OpenGL Cylinder VAO" (which I didn't find much). You might find some C++ code and try to convert.
I would use VAO's and start by drawing triangles then a disk then use the disk points to draw to a point above the disk.
Nov 24, 2014 at 8:08 PM
Edited Nov 24, 2014 at 10:29 PM
Oop's you may want it to appear solid by adding a disk to the end!
IntPtr i = new IntPtr();
i = gl.NewQuadric();
gl.QuadricNormals(i, OpenGL.GL_SMOOTH);
gl.Cylinder(i, 2, 0, 8, 120, 16);
gl.Disk(i, 2, 0, 120, 1);