0

I would like to rotate an object on a certain angle along Y axis. Based on this answer How to rotate a Three.js Vector3 around an axis? I suppose to get an updated vector.

My code is :

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

I'm using r67 and it returns me 0,0,0. I've tried r69 as well and it is returns me the same. I'm not quiet ready to move to r69. Could you guys tell me please how to do the same thing but using r67. Thanks.

Community
  • 1
  • 1
Hamabama
  • 253
  • 1
  • 3
  • 10

1 Answers1

0

Your are rotating vector (0, 0, 0) which is center and whatever angle you use to rotate center around any axis you will always get (0, 0, 0). Just imagine you are doing simple 2d rotation. After all, rotation around Y axis can be viewed as 2d rotation in X-Z plane.

Try with some other values for vec variable, for example (1, 0, 0) or (0, 0, 1) and you will see results

Igor
  • 1,835
  • 17
  • 15