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 multiple 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

OpenGL, Programming terms

  • The official OpenGL website.