Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

changing arrow head properties of ArrowHelper class Threejs

I'm using the arrow helper class, I found this example http://stemkoski.github.io/Three.js/Helpers.html and I was able to get the arrow working. However my arrowhead is much larger than I would like it to be, I currently have this code

var direction = new THREE.Vector3().subVectors(secondVector, firstVector).normalize();
var arrow = new THREE.ArrowHelper(direction, firstVector, computeDistance(node1, node2) - 32, co);
bigObject.add(arrow);

the arrow starts at firstVector and points to `secondVector

is there a way to change the size or any properties of how the arrow head gets drawn (eg stroke weight, arrowhead location, etc.) ? I didn't see anything that looked promising in the documentation.

thank you for the help!

like image 794
ekcrisp Avatar asked Dec 07 '25 00:12

ekcrisp


1 Answers

Good question, but the answer is 'No'. The head of the arrow scales with the arrow's length.

Your only solution is to create your own custom ArrowHelper.

three.js r.63

EDIT: This feature has been added to the dev branch three.js r.64dev.

var arrow = new THREE.ArrowHelper( dir, origin, length, hex, headLength, headWidth );
like image 192
WestLangley Avatar answered Dec 08 '25 13:12

WestLangley