OpenGL polygon

Updated: 12/20/2017 by Computer Hope

OpenGL polygon In computer graphics programming, an OpenGL polygon is a polygonal (multi-sided) shape drawn using the Open Graphics Library (OpenGL).

Example of an OpenGL polygon

In OpenGL, a polygon is created by specifying a series of vertices. For example, using OpenGL and C++, the following code draws a triangle:

glBegin(GL_TRIANGLES);             // Drawing Using Triangles 
    glVertex3f( 0.0f, 0.5f, 0.0f); // Top 
    glVertex3f( 0.5f,-0.5f, 0.0f); // Bottom Right 
    glVertex3f(-0.5f,-0.5f, 0.0f); // Bottom Left 
glEnd();                           // Finished Drawing The Triangle

Related Pages

OpenGL, Programming terms