Changes between Version 4 and Version 5 of tutorial


Ignore:
Timestamp:
Jun 26, 2013, 11:14:14 PM (11 years ago)
Author:
leon
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • tutorial

    v4 v5  
    8686
    8787== 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);}}}.
    8989 2. Replace single line drawing in {{{display()}}} with the following snippet
    9090 {{{
     
    108108  {1, 1, 0}, {0, 1, 1}, {1, 0, 1}};
    109109}}}
    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