#include "cone.h" Cone::Cone() { x = 0; y = 0; z = 0; scale = 0.25; vertextList=glGenLists(2); } GLuint Cone::getVertexList() { glNewList(vertextList,GL_COMPILE); // Start With The Box List glBegin(GL_QUADS); glColor3f(1.0f,0.5f,0.0f); glVertex3f( (0.2f+x),(1.4f+y), (0.2f+z)); // Top Right Of The Quad (Bottom) glVertex3f((-0.2f+x),(1.4f+y), (0.2f+z)); // Top Left Of The Quad (Bottom) glVertex3f((-0.2f+x),(1.4f+y),(-0.2f+z)); // Bottom Left Of The Quad (Bottom) glVertex3f( (0.2f+x),(1.4f+y),(-0.2f+z)); // Bottom Right Of The Quad (Bottom) glEnd(); glBegin(GL_QUADS); glVertex3f( -0.2f+x, 1.4f+y, 0.0f+z); // Top Of Triangle (Front) glVertex3f(-1.0f+x,-1.0f+y, 1.0f+z); // Left Of Triangle (Front) glVertex3f( 1.0f+x,-1.0f+y, 1.0f+z); // Right Of Triangle (Front) glVertex3f(0.2f+x,1.4f+y,0.0f+z); glVertex3f( 0.2f+x, 1.4f+y, 0.2f+z); // Top Of Triangle (Right) glVertex3f( 1.0f+x,-1.0f+y, 1.0f+z); // Left Of Triangle (Right) glVertex3f( 1.0f+x,-1.0f+y, -1.0f+z); // Right Of Triangle (Right) glVertex3f( 0.2f+x, 1.4f+y, -0.2f+z); // Top Of Triangle (Right) glVertex3f( 0.2f+x, 1.4f+y, -0.2f+z); // Top Of Triangle (Back) glVertex3f( 1.0f+x,-1.0f+y, -1.0f+z); // Left Of Triangle (Back) glVertex3f(-1.0f+x,-1.0f+y, -1.0f+z); // Right Of Triangle (Back) glVertex3f( -0.2f+x, 1.4f+y, -0.2f+z); // Top Of Triangle (Back) glVertex3f( 0.2f+x, 1.4f+y, -0.2f+z); // Top Of Triangle (Left) glVertex3f(-1.0f+x,-1.0f+y,-1.0f+z); // Left Of Triangle (Left) glVertex3f(-1.0f+x,-1.0f+y, 1.0f+z); // Right Of Triangle (Left) glVertex3f( -0.2f+x, 1.4f+y, 0.2f+z); // Top Of Triangle (Left) glEnd(); // Done Drawing The Pyramid glBegin(GL_QUADS); glVertex3f( 1.5f+x,-1.0f+y, 1.5f+z); // Top Right Of The Quad (Bottom) glVertex3f(-1.5f+x,-1.0f+y, 1.5f+z); // Top Left Of The Quad (Bottom) glVertex3f(-1.5f+x,-1.0f+y,-1.5f+z); // Bottom Left Of The Quad (Bottom) glVertex3f( 1.5f+x,-1.0f+y,-1.5f+z); // Bottom Right Of The Quad (Bottom) glEnd(); glEndList(); return vertextList; }