How to rotate a Three.js Vector3 around an axis?

MaiaVictor picture MaiaVictor · May 25, 2012 · Viewed 33.2k times · Source

How to rotate a Three.js Vector3 by a certain angle around an axis?

Answer

mrdoob picture mrdoob · May 25, 2012
var vector = new THREE.Vector3( 1, 0, 0 );

var axis = new THREE.Vector3( 0, 1, 0 );
var angle = Math.PI / 2;

vector.applyAxisAngle( axis, angle );