I have created in my code an ArrowHelper and I update its parameters by calling the function below (each call of this function updates the ArrowHelper dimensions) :
function updateArrowHelper() {
// Update parameters for transportedVector
transportedVector.arrowHelper.setLength(transportedVector.coordLocal.length(), headLengthVector, headWidthVector);
transportedVector.arrowHelper.setDirection(directionVector.normalize());
transportedVector.arrowHelper.position.copy(coordTorus);
transportedVector.arrowHelper.line.material.linewidth = widthVector;
transportedVector.arrowHelper.setColor(hexVector);
// Set head length and width to zero if dirVector.length is zero
if (transportedVector.coordLocal.length() == 0.0)
transportedVector.arrowHelper.setLength(0, 0, 0);
}
I would like to make disappear the head of ArrowHelper
if its length (given by transportedVector.coordLocal.length()
) is zero, what I have done with :
// Set head length and width to zero if dirVector.length is zero
if (transportedVector.coordLocal.length() == 0.0)
transportedVector.arrowHelper.setLength(0, 0, 0);
But at the execution, this doesn't work : even the length is null, once function is called, the head is still displayed and I don't know why ?
If anyone could see what's wrong.
Thanks in advance.
You can hide the head of the ArrowHelper
by using this pattern:
arrowHelper.cone.visible = false;
three.js r.80
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With