Adjusting ArrowHelper Width in Three.jsLooking to change the size of an Arrow

I have been attempting to adjust the width of pink lines on this jsfiddle link:

animation of object

In my code, I am defining local basis vectors as follows:

// Defining 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);

My goal is to change the width of the line created with ArrowHelper without altering the arrow itself. However, I have not been successful in finding a way to do so.

I attempted the following code snippet:

arrowHelperTheta.line.linewidth = 5;

but it did not work as expected.

While researching, I found that for the THREE.LineBasicMaterial object, we can set the width using linewidth. But how can this be achieved for the ArrowHelper object?

If anyone has advice on how to adjust the width of the line in this context, I would greatly appreciate it.

Thank you for your assistance.

Answer №1

To adjust the thickness of the line in THREE.ArrowHelper, follow these steps:

arrow = new THREE.ArrowHelper(direction, startingPoint, length, color);

arrow.line.material.linewidth = thickness;

Note that modifying the line width might not have an effect on specific Windows operating systems.

Version: three.js r.75

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What could be causing Node Pdfkit to sometimes generate a corrupted file within my code?

I've encountered an issue with my function that generates a PDF file and sends it via email using `pdfkit` and `nodemailer`. Occasionally, I receive a file that cannot be opened. I'm unsure why this happens sporadically while it works fine most o ...

Pass Form ID To Function In A Dynamic Way

I have multiple forms on my webpage and I want to use the same ajax function for all of them. It currently works well for one form by fetching the id with getElementById and then passing it to the ajax function. My goal is to dynamically pass down the form ...

Setting a fixed width for content in CSS based on the size of the browser screen

I'm a newcomer to CSS and HTML and feeling a bit lost on this issue. My goal is to divide the screen into two halves, with one half taking up 50% of the browser screen width while the other half remains flexible. I want the content in one half to be f ...

Tips for making the height of <select> and <button> elements equal even with padding

I'm trying to make sure that both the 'select' and 'button' elements have the same height. Check out my JS Fiddle here Here's the HTML code: <select><option>...</option></select><button>Button& ...

What is the best way to adjust the padding on the left and right of the Bootstrap navbar logo and menu items?

I am currently facing an issue with the alignment of the logo and menu on my website. They are currently aligned to the far edges of the screen, and I would like them to remain a set percentage distance away from the extremes, rather than an absolute dista ...

The Expressjs router prioritizes resolving before retrieving data from Firestore

UPDATE: Upon further investigation, I discovered that by adding "async" to the function signature, the output now displays in the intended order. However, I am still encountering an error regarding setting headers after they have already been sent, even th ...

Looking to confirm client-side text in NodeJS?

As I work on constructing a to-do list, one challenge I am encountering is confirming that the correct task has been checked off. While considering using unique IDs for each individual task may seem like a solution, there is still the risk of users manipul ...

Error: The method "next" cannot be used with BehaviorSubject

My goal is to share data between sibling components by utilizing a shared service. The first component loads and retrieves a list of Servers from the API, populating a select box with all the servers. I now need to notify the other component when the user ...

Having trouble navigating the Request and Response handling in Expressjs/Nodejs?

As I continue to delve deeper into this code, confusion seems to cloud my understanding. Here is the provided source: var express = require('express') , http = require('http') , server = express() ; var home = require('./ro ...

Manipulating AngularJS variables that are outside of its designated scope should be restricted

Something strange is happening in my code. I created a function called "insertTstData" outside of any angular scope, and when it is called from another function named "save" within a controller named "remark", it somehow manipulates a local variable and th ...

Vanishing Submenus

I'm experiencing an issue with my navbar and its drop-down menus. When I hover over the submenu, it doesn't stay visible as expected. I've tried different approaches such as using jQuery, the + operator in CSS, and even creating a separate h ...

Mastering the Art of jQuery Function Chaining for Beginners

I want to change the name and ID of an element when a radio button is clicked. To avoid duplication of the selector, I tried setting it up this way: $( "#selectOther" ).click(function() { $( "[field=primaryInput]" ).attr('id', "modifiedId", ...

Mastering Vue 3: Simplifying a reactive array of objects while maintaining reactivity

Struggling with maintaining reactivity in Vue 3 when flattening a nested array of objects. Unfortunately, my attempts result in crashing and browser hang-ups. In my Vue 3 component, I have an array structured as a list of objects: this.grouped = [ ...

The Firefox form is experiencing issues when the cursor is set to 'move'

I have an HTML form with a specific code snippet: #stoppage_section .stoppage{ cursor: move; /* fallback if grab cursor is unsupported */ cursor: grab; cursor: -moz-grab; cursor: -webkit-grab; } <div id="st ...

What is the best way to ensure that a child div can expand to fit within the scrollable area of its parent div

I am facing an issue with a parent div that changes size based on the content inside it. When the content exceeds the initial size, causing the parent to scroll instead of expanding, I have a child div set to 100% width and height of the parent. However, t ...

Creating a spherical shape using random particles in three.js

Can anyone assist me in creating a random sphere using particles in three.js? I can create different shapes with particles, but I'm unsure how to generate them randomly. Here's my current code: // point cloud geometry var geometry = new THREE. ...

Issue with SweetAlert2 cancel button being unresponsive while an ajax request is in progress

I have a custom function triggered when a dropdown item is selected, which triggers a sweetalert2 popup. Here's the function: function SwalPopup(ip, method) { var methodmsg = method.charAt(0).toUpperCase() + method.slice(1); swal.fire({ ...

Displaying MySQL information on an EJS document including references to other tables

Check out the project on GitHub I am currently working on retrieving quiz answers from a MySQL database and displaying them in a form using EJS templating within a node.js/express application. However, I am facing challenges with correctly mapping answers ...

Leverage the power of integrating Power BI with Javascript to easily retrieve an

I have embarked on a mission to integrate PowerBI into my web application. Below is the code snippet that I have implemented: window.config = { instance: 'https://login.microsoftonline.com/', tenant: 'common', //COMMON OR YOU ...

Encountering the error message "Unable to locate module '.nextserverpages-manifest.json'" while attempting to include `babel.config.js` in a Next.js application

During the process of setting up testing for my current next app, we incorporated some new dependencies including jest, babel-jest, @babel/preset-env, @babel/preset-react, and react-test-renderer. We also created a babel.config.js file to configure Babel s ...