18.07.2014 Views

An Interactive Introduction to OpenGL Programming

An Interactive Introduction to OpenGL Programming

An Interactive Introduction to OpenGL Programming

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Specifying Geometric<br />

Primitives<br />

• Primitives are specified using<br />

glBegin( primType );<br />

glEnd();<br />

• primType determines how vertices are combined<br />

glBegin( primType );<br />

for ( i = 0; i < n; ++i ) {<br />

glColor3f( red[i], green[i], blue[i] );<br />

glVertex3fv( coords[i] );<br />

}<br />

glEnd();

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!