Are you looking to randomize the images in your project?
// create Array of different image materials.
var images = [
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( '1.jpg' ) } ),
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( '2.jpg' ) } ),
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( '3.jpg' ) } ),
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( '4.jpg' ) } ),
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( '5.jpg' ) } ),
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( '6.jpg' ) } ),
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( '7.jpg' ) } ),
new THREE.MeshBasicMaterial( { map: THREE.ImageUtils.loadTexture( '8.jpg' ) } )
];
group = new THREE.Group();
for ( var i = 0; i < 60; i ++ ) {
// clone the array so we can select unique images for each cube.
var clone = images.splice(0);
var newArray = [];
for(var j = 0, j < 6, j++){
newArray[j] = clone.splice(Math.floor(Math.random() * clone.length-1), 1);
}
// create material.
var material = new THREE.MeshFaceMaterial(newArray);
var mesh = new THREE.Mesh( geometry, material );
mesh.position.x = Math.random() * 1000 - 500;
mesh.position.y = Math.random() * 1000 - 500;
mesh.position.z = Math.random() * 1000 - 500;
mesh.rotation.x = Math.random() * 2 * Math.PI;
mesh.rotation.y = Math.random() * 2 * Math.PI;
mesh.matrixAutoUpdate = false;
mesh.updateMatrix();
group.add( mesh );
}
scene.add( group );
This code is experimental, but it demonstrates the concept.