I am currently learning threejs and I am trying to apply 6 different textures to each side of a cube. I initially achieved this using loadTexture.
var material3 = new THREE.MeshPhongMaterial( {map: THREE.ImageUtils.loadTexture('textures/ps.png')} );
However, I encountered an issue when attempting to use the deprecated THREE.ImageUtils.loadTexture method while saving 6 materials in an array and using THREE.MeshFaceMaterial. I now need to use THREE.TextureLoader instead, but I am unsure of how to load 6 textures using this method.
Here is my current code:
function texture()
{
var loader = new THREE.TextureLoader();
loader.load( 'textures/ps.png', function ( texture )
{
var geometry = new THREE.CubeGeometry( 10, 10, 10 );
var material = new THREE.MeshBasicMaterial( { map: texture, overdraw: 0.5 } );
mesh = new THREE.Mesh( geometry, material );
mesh.position.z = -50;
scene.add( mesh );
} );
}