text: 
  var cubeVertexBuffer, cubeColorBuffer, cubeIndexBuffer;
  
  var s = 1; //size of cube
  var cubeVertices = new Float32Array([
      -s,-s,-s, s,-s,-s, s, s,-s, -s, s,-s,
      -s,-s, s, s,-s, s, s, s, s, -s, s, s,
      -s,-s,-s, -s, s,-s, -s, s, s, -s,-s, s,
      s,-s,-s, s, s,-s, s, s, s, s,-s, s,
      -s,-s,-s, -s,-s, s, s,-s, s, s,-s,-s,
      -s, s,-s, -s, s, s, s, s, s, s, s,-s,
  ]);
  
  var cubeColors = new Float32Array([
      0,1,1, 0,1,0, 0,1,0, 0,1,0,
      1,0,1, 1,0,1, 1,0,1, 1,0,1,
      1,0,0, 1,0,0, 1,0,0, 1,0,0,
      0,0,1, 0,0,1, 0,0,1, 0,0,1,
      1,1,0, 1,1,0, 1,1,0, 1,1,0,
      0,1,0, 0,1,0, 0,1,0, 0,1,0
  ]);
  
  var cubeIndices =  new Float32Array([
      0,1,2, 0,2,3,
      4,5,6, 4,6,7,
      8,9,10, 8,10,11,
      12,13,14, 12,14,15,
      16,17,18, 16,18,19,
      20,21,22, 20,22,23
  ]);
  
  
  
  function initCubeBuffer() {
  
      cubeVertexBuffer = gl.createBuffer();
      gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer);
      gl.bufferData(gl.ARRAY_BUFFER, cubeVertices, gl.STATIC_DRAW);
  
      cubeColorBuffer = gl.createBuffer();
      gl.bindBuffer(gl.ARRAY_BUFFER, cubeColorBuffer);
      gl.bufferData(gl.ARRAY_BUFFER, cubeColors, gl.STATIC_DRAW);
  
      cubeIndexBuffer = gl.createBuffer ();
      gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeIndexBuffer);
      gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, new Uint16Array(cubeIndices), gl.STATIC_DRAW);
  }
  
  function setColorBuffer(cubeColors) {
      cubeColorBuffer = gl.createBuffer();
      gl.bindBuffer(gl.ARRAY_BUFFER, cubeColorBuffer);
      gl.bufferData(gl.ARRAY_BUFFER, cubeColors, gl.STATIC_DRAW);
  }
  
  function renderCube(context) {
      //setting the model view and projection matrix on shader
      setUpModelViewMatrix(context.sceneMatrix, context.viewMatrix);
  
      var positionLocation = gl.getAttribLocation(context.shader, 'a_position');
      gl.bindBuffer(gl.ARRAY_BUFFER, cubeVertexBuffer);
      gl.vertexAttribPointer(positionLocation, 3, gl.FLOAT, false,0,0) ;
      gl.enableVertexAttribArray(positionLocation);
  
      var colorLocation = gl.getAttribLocation(context.shader, 'a_color');
      gl.bindBuffer(gl.ARRAY_BUFFER, cubeColorBuffer);
      gl.vertexAttribPointer(colorLocation, 3, gl.FLOAT, false,0,0) ;
      gl.enableVertexAttribArray(colorLocation);
  
      gl.uniform1f(gl.getUniformLocation(context.shader, 'u_alpha'), 1);
  
      gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, cubeIndexBuffer);
      gl.drawElements(gl.TRIANGLES, cubeIndices.length, gl.UNSIGNED_SHORT, 0); //LINE_STRIP
  }