| | 86 | === Exercise #1: === |
| | 87 | 1. Add RGB color to vertices with {{{ glColor3f(1.0, 0.4, 1.0);}}}. |
| | 88 | 2. Replace single line drawing in {{{display}}} with the following snippet |
| | 89 | {{{ |
| | 90 | #!c |
| | 91 | GLfloat vertices[][2] = { |
| | 92 | { -0.90, -0.90 }, // Triangle 1 |
| | 93 | { 0.85, -0.90 }, |
| | 94 | { -0.90, 0.85 }, |
| | 95 | { 0.90, -0.85 }, // Triangle 2 |
| | 96 | { 0.90, 0.90 }, |
| | 97 | { -0.85, 0.90 } |
| | 98 | }; |
| | 99 | }}} |
| | 100 | and try to draw two wireframe triangles in a loop. Change primitive to {{{GL_LINE_LOOP}}}. |
| | 101 | 3. Draw two primitives with {{{GL_TRIANGLES}}}. |
| | 102 | |
| | 103 | |
| | 104 | |