13.003 Computational Geometry and Visualization

OpenGL Geometric Primitives


Geometry is drawn by specifying the geometric type and a sequence of vertices.

    glBegin(type);
    glVertex2f(x, y);
    glVertex2f(x, y);
    ...
    glEnd();

The geometric types include points, lines, and polygons:

Several forms of the vertex function are available for different dimensionality and argument types:

    glVertex{234}{sifd}(x, y [, z [, w]]);

where the curly braces { and } indicate the selection of one character from the list of alternatives, and the square brackets [ and ] indicate optional arguments.


On to "OpenGL Drawing Style"
Back to "Introduction to graphics with OpenGL"
Back to "Lectures on OpenGL and Computer Graphics"