Wiki
Clarifications for Angel's Interactive Computer Graphics

Chapter 2 (Worksheet 1)
Page last edited by Jeppe Revall Frisvad (jerf) 05/09-2017

In Sec. 2.8.6, the following line of code:

program = initShaders("vertex-shader", "fragment-shader");

should be

program = initShaders(gl, "vertex-shader", "fragment-shader");

as in the code snippet on the following page.

In Sec. 2.10.3, please note that the following three lines

var vColor = gl.getAttribLocation(program, "vColor");
gl.vertexAttribPointer(vColor, 3, gl.FLOAT, false, 0, 0);
gl.enableVertexAttribArray(vColor);

which enable the vertex color attribute, need to be called while the color buffer (cBuffer) is bound. This means that the three lines cannot be inserted directly after the six lines of code preceding them in the text.

Support: +45 45 25 74 43