My first attempt at using three.js involves a basic particle animation with 4 different textures mapped onto them. Everything is working smoothly so far, except for one issue - I can't seem to rotate the particles randomly for different orientations (upside down, sideways, etc.). Can anyone provide guidance on how to achieve this? Any help would be greatly appreciated!
You can view my current progress here:
Below is the relevant code snippet:
sprite1 = THREE.ImageUtils.loadTexture( "sprite1.png" );
sprite2 = THREE.ImageUtils.loadTexture( "sprite2.png" );
sprite3 = THREE.ImageUtils.loadTexture( "sprite3.png" );
sprite4 = THREE.ImageUtils.loadTexture( "sprite4.png" );
parameters = [ sprite1, sprite2, sprite3, sprite4];
for ( i = 0; i < parameters.length; i ++ ) {
sprite = parameters[i];
materials[i] = new THREE.PointCloudMaterial( { size: 45, map: sprite, depthTest: false, transparent : true} );
particles = new THREE.PointCloud( geometry, materials[i] );
particles.rotation.x = Math.random() * 60;
particles.rotation.y = Math.random() * 60;
particles.rotation.z = Math.random() * 60;
scene.add( particles );
}
Utilizing three.js r71