program.js
// Pass an updated model-view matrix to the graphics card.
Pass an updated model-view matrix to the graphics card.
Pass an updated model - view matrix to the graphics card .
function updateModelView(modelView) {
	normalMatrix = [
        vec3(modelView[0][0], modelView[1][0], modelView[2][0]),
        vec3(modelView[0][1], modelView[1][1], modelView[2][1]),
        vec3(modelView[0][2], modelView[1][2], modelView[2][2])
    ];
    gl.uniformMatrix4fv(locations.modelView, false, flatten(modelView));
	gl.uniformMatrix3fv(locations.normalMatrix, false, flatten(normalMatrix) );
}
function updateModelView ( modelView ) { normalMatrix = [ vec3 ( modelView [ 0 ] [ 0 ] , modelView [ 1 ] [ 0 ] , modelView [ 2 ] [ 0 ] ) , vec3 ( modelView [ 0 ] [ 1 ] , modelView [ 1 ] [ 1 ] , modelView [ 2 ] [ 1 ] ) , vec3 ( modelView [ 0 ] [ 2 ] , modelView [ 1 ] [ 2 ] , modelView [ 2 ] [ 2 ] ) ] ; gl . uniformMatrix4fv ( locations . modelView , false , flatten ( modelView ) ) ; gl . uniformMatrix3fv ( locations . normalMatrix , false , flatten ( normalMatrix ) ) ; }
Pass an updated model-view matrix to the graphics card.
Pass an updated model - view matrix to the graphics card .