Open GL Graphic Primitives
← OpenGL State | ● | OpenGL Transparency →
A 3D scene is made up from 3D objects, which are defined by a set of triangles, a so called triangle mesh. Each triangle consists of 3 vertices with associated attributes defined by the actual rendering state. A series of vertices is started with the glBegin() command, whereas it is ended with the glEnd() command:
For example a series of 3 vertices that make up a red triangle consists of the following OpenGL commands:
glBegin(GL_TRIANGLES);
glVertex3f(0,0,-10);
glVertex3f(-1,1,-10);
glVertex3f(1,1,-10);
glEnd();
Each glVertex command immediately sends a new point with the actual attributes to the rendering pipeline.
← OpenGL State | ● | OpenGL Transparency →