Arrow
The arrow() function creates a 3D arrow object in the scene. You can specify the start
and end points of the arrow, as well as the optional head length.
arrow([0, 0, 0], [0, 100, 0]); arrow([-50, 0, 0], [-50, 0, 100]) .dashed(5, 5) .color({ from: "magenta", to: "cyan" });
If you only need a vector originating from (0, 0, 0), consider using the vector() function instead.
Returns the Arrow object:
Arrow
Example usage:
arrow.linewidth(2).dashed();
field
mesh: THREE.Group
The Group mesh containing the line and cone of the arrow.
Example
arrow.mesh.rotateZ(Math.PI / 6);
field
line: LineStrip
The line part of the arrow.
Example
arrow.line.linewidth(2);
field
cone: Cone
The cone part of the arrow.
Example
arrow.cone.radius(0.1);
method
pos(position: Vec3): Arrow
Set the position of the object.
param position
A vector-like object representing the position.Example
arrow.pos([1, 0, 0]);
method
color(color: ArrowColor): Arrow
Sets the color of the arrow.
param color
A color or an object defining from/to colors.Example
arrow.color({ from: "magenta", to: "cyan" });
method
material(material: LineMaterial): Arrow
Sets the material of the arrow.
param material
The new material for the arrow.Example
arrow.material(new LineMaterial());
method
linewidth(width: number): Arrow
Sets the line width of the arrow.
param width
The new line width.Example
arrow.linewidth(3);
method
dashed(dashSize?: number, gapSize?: number): Arrow
Sets the arrow line to be dashed. If no parameters are provided, default values are used.
param dashSize
Size of the dashes.param gapSize
Size of the gaps between dashes.Example
arrow.dashed(2, 1);