gameninja
gameninja

Reputation: 61

Disable Particle rotation in Three.js

I'm trying to use Three.js to create an ’asteroid field' using particle systems or point clouds or stuff like that. One of the problems I've bumped into with all of these is that when the camera rotates around the z axis, the particles rotate individually with the camera, preserving the same orientation no matter how the camera is turned. I want the simulation to look as if the user is flying through a bunch of asteroids, and obviously asteroids don't magically spin whenever you tilt your head, so I was wondering if there is any way to prevent them from turning when the camera turns. Must particles always be upright?

Upvotes: 3

Views: 829

Answers (1)

Martin
Martin

Reputation: 2673

If you want to rotate sprites you can use attribute SpriteMaterial.rotation:

 var sprite = new THREE.Sprite( new THREE.SpriteMaterial({map: texture,rotation: Math.PI/4}));

see this http://threejs.org/examples/webgl_sprites.html

In your case, rotation of all sprites should be equal to camera rotation.

Upvotes: 1

Related Questions