I'm currently working on a space scene where I'm using a particle system to create a group of asteroids. I'd like to rotate each asteroid on its own axis. Below is the code snippet I'm using to set up the particle system:
var asteroidGeometry = new THREE.Geometry();
for(var i=0;i<=10000;i++)
{
asteroidGeometry.vertices.push( new THREE.Vector3( Math.random()*10000-5000, Math.random()*10000-5000, Math.random()*10000-5000 ) );
}
var asteroidTexture= THREE.ImageUtils.loadTexture("images/asteroids.png");
var asteroidMaterial = new THREE.ParticleBasicMaterial({color: 'white',size:500,map: asteroidTexture, alphaTest: 0.8});
asteroids = new THREE.ParticleSystem(asteroidGeometry, asteroidMaterial);
scene.add(asteroids);
If I try something like this:
asteroid.position.x += 0.1;
it rotates the entire system. Is there a way to rotate each particle on its own axis?