three.js - Create ArrowHelper with correct rotation -


how create arrowhelper in three.js (r58) correct rotation?

var point1 = new three.vector3(0, 0, 0); var point2 = new three.vector3(10, 10, 10); var direction = new three.vector3().subvectors(point1, point2); var arrow = new three.arrowhelper(direction.normalize(), point1); console.log(arrow.rotation); 

i end with object {x: 0, y: 0, z: 0} arrow rotation. doing wrong?

arrowhelper uses quaternions specify it's orientation.

if this:

var rotation = new three.euler().setfromquaternion( arrow.quaternion ); 

you see equivalent orientation expressed in euler angles, although in r.59, arrow.rotation automatically updated, no longer see zeros.

edit: answer updated three.js r.59


Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -