/* global c */

function render(el) {
  var gl = el.getContext('webgl');
  gl.clearColor(0, 0, 0, 0);
  gl.clear(gl.COLOR_BUFFER_BIT);
}

c.width = window.innerWidth;
c.height = window.innerHeight;
render(c);

@@ -13,124 +13,2203 @@
 */%0A%0A
-function render(el) %7B%0A  var gl = el.getContext('webgl');%0A  gl.clearColor(0, 0, 0, 0);%0A  gl.clear(gl.COLOR_BUFFER_BIT
+import %7B boxGeom_create %7D from './boxGeom';%0Aimport %7B bufferGeom_create, bufferGeom_fromGeom %7D from './bufferGeom';%0Aimport %7B camera_create %7D from './camera';%0Aimport %7B mat4_getInverse, mat4_multiplyMatrices %7D from './mat4';%0Aimport %7B mesh_create %7D from './mesh';%0Aimport %7B object3d_updateMatrix, object3d_updateMatrixWorld %7D from './object3d';%0Aimport %7B quat_setFromEuler %7D from './quat';%0Aimport %7B createShaderProgram, setFloat32Attribute, setMat4Uniform %7D from './shader';%0Aimport %7B vec3_create %7D from './vec3';%0A%0Avar box = boxGeom_create(1, 1, 1);%0Avar bufferGeom = bufferGeom_fromGeom(bufferGeom_create(), box);%0Avar mesh = mesh_create(box);%0Aquat_setFromEuler(mesh.quaternion, vec3_create(0, 0, -Math.PI / 6));%0A%0Avar camera = camera_create(60, window.innerWidth / window.innerHeight);%0A%0Acamera.position.x = 1;%0Acamera.position.y = 2;%0Acamera.position.z = 8;%0A%0Aobject3d_updateMatrix(mesh);%0Aobject3d_updateMatrixWorld(mesh);%0Aobject3d_updateMatrix(camera);%0Aobject3d_updateMatrixWorld(camera);%0Amat4_getInverse(camera.matrixWorldInverse, camera.matrixWorld);%0Amat4_multiplyMatrices(mesh.modelViewMatrix, camera.matrixWorldInverse, mesh.matrixWorld);%0A%0Afunction render(el) %7B%0A  var gl = el.getContext('webgl');%0A  gl.clearColor(0, 0, 0, 0);%0A  gl.clear(gl.COLOR_BUFFER_BIT);%0A%0A  var program = createShaderProgram(%0A    gl,%0A%0A    'precision highp float;' +%0A    'precision highp int;' +%0A     // modelViewMatrix%0A    'uniform mat4 M;' +%0A    // projectionMatrix%0A    'uniform mat4 P;' +%0A    // position%0A    'attribute vec3 p;' +%0A    // // normal%0A    // 'attribute vec3 n;' +%0A    // // color%0A    // 'attribute vec3 c;' +%0A    // // vColor%0A    // 'varying vec3 vc;' +%0A    'void main()%7B' +%0A      // 'vc = c;' +%0A      'gl_Position=P*M*vec4(p,1.0);' +%0A    '%7D',%0A%0A    'precision highp float;' +%0A    'precision highp int;' +%0A    // 'varying vec3 vc;' +%0A    'void main()%7B' +%0A      // 'gl_FragColor=vec4(vc,1.0);' +%0A      'gl_FragColor=vec4(1.0);' +%0A    '%7D'%0A  );%0A%0A  gl.useProgram(program);%0A%0A  setMat4Uniform(gl, program, 'M', mesh.modelViewMatrix);%0A  setMat4Uniform(gl, program, 'P', camera.projectionMatrix);%0A  setFloat32Attribute(gl, program, 'p', 3, bufferGeom.attrs.p);%0A%0A  gl.drawArrays(gl.TRIANGLES, 0, bufferGeom.attrs.p.length / 3
 );%0A%7D

Add Hello world! box