I’ve been stuck trying to draw an arrow using THREE.ArrowHelper
for multiple hours now, hopefully, someone can shine some light on the issue. My code is as follows:
function draw_an_arrow(name, from, to, color, layer) {
let direction = to.clone().sub(from)
let length = direction.length()
let obj = new THREE.ArrowHelper(direction.normalize(), from, length, color)
obj.name = name
obj.layers.set(layer)
scene.add(obj)
return obj
}
The name
, from
, to
, color
, and layer
are provided function parameters in the correct format. This is verified. The provided layer
and scene
also work. When drawing anything else within the same function such as a plane, circle, or even line they show up. Since my visualization is 2D, all objects are drawn with z-coordinate 0 and my camera hovers orthogonally over x-y-plane.
The code I am using follows most of the examples I found online to the letter. What am I missing?