沿着THREE.Line或两个向量绘制箭头帮助器

时间:2014-11-03 12:20:47

标签: three.js

是否可以绘制箭头助手,有两个向量(x1,y1,z1)(x2,y2,z2),请给出你的建议和指导.. enter image description here

提前致谢...

1 个答案:

答案 0 :(得分:7)

您可以从这样的2个向量中获取方向并创建箭头助手

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小提琴工作 http://jsfiddle.net/pardo/bgyem42v/3/