title: three.js plane buffergeometry uvs
body: <p>I'm trying to create a buffergeometry plane, I'm having troubles with the uv coordinates though. I've tried to follow <a href="https://stackoverflow.com/questions/19891507/correct-uv-mapping-three-js">Correct UV mapping Three.js</a> yet I don't get a correct result.</p>
  
  <p>The uv code is below. I also saved the entire buffergeometry code at <a href="http://jsfiddle.net/94xaL/" rel="nofollow noreferrer">http://jsfiddle.net/94xaL/</a>.</p>
  
  <p>I would very much appreciate a hint on what I'm doing wrong here!</p>
  
  <p>Thanks!</p>
  
  <pre><code>    var uvs = terrainGeom.attributes.uv.array;
      var gridX = gridY = TERRAIN_RES - 1;
      for ( iy = 0; iy &lt; gridY; iy++ ) {
          for ( ix = 0; ix &lt; gridX; ix++ ) {
  
              var i = (iy * gridY + ix) * 12;
  
              //0,0
              uvs[ i ] = ix / gridX
              uvs[ i + 1 ] = iy / gridY;
  
              //0,1
              uvs[ i + 2 ] = ix / gridX
              uvs[ i + 3 ] = ( iy + 1 ) / gridY;
  
              //1,0
              uvs[ i + 4 ] = ( ix + 1 ) / gridX
              uvs[ i + 5 ] = iy / gridY;
  
              //0,1
              uvs[ i + 6 ] = ix / gridX
              uvs[ i + 7 ] = ( iy + 1 ) / gridY;
  
              //1,1
              uvs[ i + 8 ] = ( ix + 1 ) / gridX
              uvs[ i + 9 ] = ( iy + 1 ) / gridY;
  
              //1,0
              uvs[ i + 10 ] = ( ix + 1 ) / gridX
              uvs[ i + 11 ] = iy / gridY;
          }
      }
  </code></pre>