From Ohm

Open GL Graphic Primitives

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:

glColor3f(1,0,0);
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.

Retrieved from http://schorsch.efi.fh-nuernberg.de/roettger/index.php/MedicalVisualization/OpenGLGraphicPrimitives

Page last modified on October 28, 2014, at 03:59 PM