title: three.js: BufferGeometry with texture coordinates
body: <p>I could not found example of THREE.BufferGeometry with texture coordinates. Is it supposed to be used for textured mesh? I can't get it to work. Here is my test code:</p>
  <pre class="lang-js prettyprint-override"><code>var quad_vertices =
  [
      -30.0,  30.0, 0.0,
       30.0,  30.0, 0.0,
       30.0, -30.0, 0.0,
      -30.0, -30.0, 0.0
  ];
  
  var quad_uvs =
  [
      0.0, 0.0,
      1.0, 0.0,
      1.0, 1.0,
      0.0, 1.0
  ];
  
  var quad_indices =
  [
      0, 2, 1, 0, 3, 2
  ];
  
  var geometry = new THREE.BufferGeometry();
  
  geometry.attributes =
  {
      position:
      {
          itemSize: 3,
          array: new Float32Array(3 * 4)
      },
  
      uv:
      {
          itemSize: 2,
          array: new Float32Array(2 * 4)
      },
  
      index:
      {
          itemSize: 1,
          array: new Uint16Array(6)
      }
  };
  
  var positions = geometry.attributes.position.array;
  var uvs       = geometry.attributes.uv.array;
  var indices   = geometry.attributes.index.array;
  
  var i;
  for(i = 0; i &lt; positions.length; i += 3)
  {
      positions[i]     = quad_vertices[i];
      positions[i + 1] = quad_vertices[i + 1];
      positions[i + 2] = quad_vertices[i + 2];
  }
  
  for(i = 0; i &lt; uvs.length; i += 2)
  {
      uvs[i]     = quad_uvs[i];
      uvs[i + 1] = quad_uvs[i + 1];
  }
  
  for(i = 0; i &lt; indices.length; i++)
      indices[i] = quad_indices[i];
  
  var texture = THREE.ImageUtils.loadTexture('./assets/texture.png');
  texture.anisotropy = renderer.getMaxAnisotropy();
  
  var material = new THREE.MeshBasicMaterial( { map: texture } );
  
  var mesh = new THREE.Mesh(geometry, material);
  
  mesh.position.z = -100;
  
  scene.add(mesh);
  </code></pre>
  <p>Just creating mesh with THREE.Geometry is OK so I have no idea what can be wrong with this code. Any thoughts?</p>