gpt4 book ai didi

three.js - 沿着 THREE.Line 或两个向量绘制箭头助手

转载 作者:行者123 更新时间:2023-12-01 09:24:57 25 4
gpt4 key购买 nike

是否可以用两个向量(x1,y1,z1)(x2,y2,z2)绘制箭头助手,请对此提出建议和指导。 enter image description here

提前谢谢...

最佳答案

您可以像这样从 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 fiddle 工作 http://jsfiddle.net/pardo/bgyem42v/3/

关于three.js - 沿着 THREE.Line 或两个向量绘制箭头助手,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26714230/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com