06-fun/scripts/06-02-modelloader.js
/**
 * Initializes all variables, shaders, and WebGL options 
 * needed for this program.
 */
Initializes all variables, shaders, and WebGL options
needed for this program.
Initializes all variables shaders and WebGL options needed for this program .
function init() {
    gl.clearColor(0.0, 0.0, 0.0, 0.0);
    gl.enable(gl.DEPTH_TEST);
    gl.depthMask(true);
    gl.disable(gl.BLEND);
    mvmat = mat4.create();
    projmat = mat4.create();
    nmat = mat3.create();
    vbo = gl.createBuffer();
    lineIndices = gl.createBuffer();
    triIndices = gl.createBuffer();
    vbo.length = 0;
    lineIndices.length = 0;
    initShaders();
    reshape();
}
function init ( ) { gl . clearColor ( 0.0 , 0.0 , 0.0 , 0.0 ) ; gl . enable ( gl . DEPTH_TEST ) ; gl . depthMask ( true ) ; gl . disable ( gl . BLEND ) ; mvmat = mat4 . create ( ) ; projmat = mat4 . create ( ) ; nmat = mat3 . create ( ) ; vbo = gl . createBuffer ( ) ; lineIndices = gl . createBuffer ( ) ; triIndices = gl . createBuffer ( ) ; vbo . length = 0 ; lineIndices . length = 0 ; initShaders ( ) ; reshape ( ) ; }
Initializes all variables, shaders, and WebGL options
 needed for this program.
Initializes all variables shaders and WebGL options needed for this program .
// Set the clear color to fully transparent black // Create the model-view matrix and projection matrix // Create all buffer objects and reset their lengths // Initialize the shaders // Reshape the canvas, and setup the viewport and projection