Draw helper arrow along THREE.Line or two vectors

Is it possible to draw an arrow helper with two vectors (x1, y1, z1) (x2, y2, z2), please give your recommendations and advice on it. enter image description here

Thanks in advance...

+3


source to share


1 answer


you can get direction from 2 vectors like this and create an arrow helper

var from = new THREE.Vector3( 2, 2, 2 );
var to = new THREE.Vector3( 0, 0, 0 );
var direction = to.clone().sub(from);
var length = direction.length();
var arrowHelper = new THREE.ArrowHelper(direction.normalize(), from, length, 0xff0000 );
scene.add( arrowHelper );

      



Js fiddle works http://jsfiddle.net/pardo/bgyem42v/3/

+6


source







All Articles