简体   繁体   English

Three.js-如何修改ArrowHelper的宽度

[英]Three.js - How to modify width of ArrowHelper

I try to modify the width of pink lines on the following jsfiddle link : 我尝试在以下jsfiddle链接上修改粉红色线条的宽度:

animation of object 对象的动画

As you can see, I define local basis vector by : 如您所见,我通过以下方式定义局部基向量:

// Add local vector axis of plane
var thetadir = new THREE.Vector3( 1, 0, 0 );
var phidir = new THREE.Vector3( 0, -1, 0 );
var originPlane = new THREE.Vector3( 0, 0, -radius );
var lengthPlane = 5;
var headLengthPlane = 1;
var headWidthPlane = 1;
var hex = 0xff00ff;

var arrowHelperTheta = new THREE.ArrowHelper( thetadir, originPlane, lengthPlane, hex, headLengthPlane, headWidthPlane );
var arrowHelperPhi = new THREE.ArrowHelper( phidir, originPlane, lengthPlane, hex, headLengthPlane, headWidthPlane );
camera.add( arrowHelperTheta );
camera.add( arrowHelperPhi );

I don't want to change the width of arrow but the part of line created with ArrowHelper. 我不想更改箭头的宽度,而是要更改使用ArrowHelper创建的线的一部分。 After some research, I didn't find a way to achieve this. 经过一番研究,我没有找到实现这一目标的方法。

For example, I tried with : 例如,我尝试使用:

arrowHelperTheta.line.linewidth = 5;

but without success. 但没有成功。

I saw that for THREE.LineBasicMaterial object, we can specify the width with linewidth , but what's about ArrowHelper object ? 我看到对于THREE.LineBasicMaterial对象,我们可以使用linewidth指定宽度,但是ArrowHelper对象又如何呢?

Someone could give some advices to change this width ? 有人可以提出一些建议来更改此宽度吗?

Thanks for your help 谢谢你的帮助

You can change the line width for THREE.ArrowHelper like so: 您可以像这样更改THREE.ArrowHelper线宽:

arrowHelper = new THREE.ArrowHelper( dir, origin, length, color );

arrowHelper.line.material.linewidth = width;

The linewidth setting may not work on certain Windows platforms. 线宽设置可能不适用于某些Windows平台。

three.js r.75 three.js r.75

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM