Calculate = function (a, b) {
return a + b;
}
gl.bindBuffer(gl.ARRAY_BUFFER, triangleVertexPositionBuffer); // <==== ВОТ BINDBUFFER
var vertices = [
0.0, 1.0, 0.0,
-1.0, -1.0, 0.0,
1.0, -1.0, 0.0
];
gl.bufferData(gl.ARRAY_BUFFER, new Float32Array(vertices), gl.STATIC_DRAW);
triangleVertexPositionBuffer.itemSize = 3;
triangleVertexPositionBuffer.numItems = 3;
// \/ ВОТ НАША ФУНКЦИЯ
gl.vertexAttribPointer(shaderProgram.vertexPositionAttribute, triangleVertexPositionBuffer.itemSize, gl.FLOAT, false, 0, 0);