title: UV mapping a blender.obj with multiple parts using faceVertexUvs. THREE.js
body: <p>I am attempting to texture/UV map a model created in blender with a custom map in three.js... when I try to apply the mapped part of the texture I get this error: </p>
  
  <pre><code>Uncaught TypeError: Cannot read property '3' of undefined
  </code></pre>
  
  <p>From</p>
  
  <pre><code>object.faceVertexUvs[3][1] = [ TorsoFront[0], TorsoFront[1], TorsoFront[3] ];
  </code></pre>
  
  <p>I am manually creating a table of locations: </p>
  
  <pre><code>var TorsoFront = [new THREE.Vector2(.7168, .6191), new THREE.Vector2(.4921, .6191), new THREE.Vector2(.4921, .8466), new THREE.Vector2(.7168, .8466)];
      var TorsoBack = [new THREE.Vector2(0, .666), new THREE.Vector2(.5, .666), new THREE.Vector2(.5, 1), new THREE.Vector2(0, 1)];
      var TorsoLeft = [new THREE.Vector2(0, .666), new THREE.Vector2(.5, .666), new THREE.Vector2(.5, 1), new THREE.Vector2(0, 1)];
      var TorsoRight = [new THREE.Vector2(0, .666), new THREE.Vector2(.5, .666), new THREE.Vector2(.5, 1), new THREE.Vector2(0, 1)];
  </code></pre>
  
  <p>And so on for the other parts of the model, from this image</p>
  
  <pre><code>var AvatarTexture = new THREE.MeshPhongMaterial( { map: THREE.ImageUtils.loadTexture('./Avatar/VintousTemplate.jpg'), shininess: 100 } );
  
  mesh = new THREE.Mesh(object, AvatarTexture );
  scene.add( mesh );
  </code></pre>
  
  <p>The model from blender has no UV mapping of itself, I am trying to create it manually in three.js.</p>
  
  <p>If it helps any, this is how I am loading in the model and MTL file:</p>
  
  <pre><code>THREE.Loader.Handlers.add( /\.dds$/i, new THREE.DDSLoader() );
  
              var mtlLoader = new THREE.MTLLoader();
              mtlLoader.setBaseUrl( './Avatar/' );
              mtlLoader.setPath( './Avatar/' );
              mtlLoader.load( 'Avatar.mtl', function( materials ) {
  
                  materials.preload();
  
                  var objLoader = new THREE.OBJLoader();
                  objLoader.setMaterials( materials );
                  objLoader.setPath( './Avatar/' );
                  objLoader.load( 'Avatar.obj', function ( object )
  </code></pre>
  
  <p>Does anyone know what might be wrong? Do you need anymore information?</p>