title: ThreeJS cube with different texture faces lit by point light with canvas renderer?
body: <p>I am trying to draw a cube that uses 6 different images for textures, one for each face.  I would like to illuminate the cube with a point light source.</p>
  
  <p>I'm using the canvas renderer because that is the platform available on iOS.</p>
  
  <p>I understood that the Lambert was the way to go.  I built my materials array using <code>MeshLambertMaterial</code>.</p>
  
  <p>I managed to get the cube with different faces to render, but without illumination working, <a href="http://www.evanz.net/threejs/test_threejs.html" rel="nofollow">see this link</a>.</p>
  
  <p>Here I used: </p>
  
  <pre><code>cube = new THREE.Mesh(geometry, new THREE.MeshFaceMaterial());
  </code></pre>
  
  <p>(You need to use Firefox to view this, it looks horrendous in Safari on the Mac (but that's a different issue), but it's fine in the iPhone simulator.)</p>
  
  <p>I also got a version working where the illumination works, but the faces all have the same colour, the texture images appearing to be lost, <a href="http://www.evanz.net/threejs/test_threejs2.html" rel="nofollow">see this link</a>.</p>
  
  <p>Here I used</p>
  
  <pre><code>cube = new THREE.Mesh(geometry, new THREE.MeshLambertMaterial());
  </code></pre>
  
  <p>Unfortunately I can't get textured faces and lighting working together.</p>
  
  <p>The code differs on only that one line.</p>
  
  <p>I must be doing something wrong, but I can't figure out what it is, all my googling has been to no avail. I'd be grateful if somebody could point me in the right direction.</p>
  
  <p>BTW thanks to the author for this brilliant software.</p>