Changes between Version 4 and Version 5 of tutorial
- Timestamp:
- Jun 26, 2013, 11:14:14 PM (11 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
tutorial
v4 v5 86 86 87 87 == Exercise #1: == 88 1. Add RGB color to vertices with {{{ glColor3f( 1.0, 0.4, 1.0);}}}.88 1. Add RGB color to vertices with {{{ glColor3f(0.0, 0.4, 1.0);}}}. 89 89 2. Replace single line drawing in {{{display()}}} with the following snippet 90 90 {{{ … … 108 108 {1, 1, 0}, {0, 1, 1}, {1, 0, 1}}; 109 109 }}} 110 110 5. Replace loop with the following 111 {{{ 112 #!c 113 glVertexPointer(2, GL_FLOAT, 0, &vertices[0][0]); 114 glEnableClientState(GL_VERTEX_ARRAY); 115 glDrawArrays(GL_TRIANGLES, 0, 6); 116 glDisableClientState(GL_VERTEX_ARRAY); 117 }}} 118 How can we add color to vertices? See [http://www.opengl.org/sdk/docs/man2/xhtml/glColorPointer.xml glColorPointer] and