I am trying to increase the width of the lines in the Axeshelper I have added to my scene.
I tried to apply a material with the line width of my choice, but applying it to the Axeshelper didn’t affect anything.
Do you have any idea how to increase the line width of the 3 axes in the Axeshelper?
Its not possible. You need to create your own version of AxesHelper using code from fat lines example
If you decide to do this, note this line in the animate method is important, otherwise, nothing is rendered. It doesn’t have to be in every frame like the example, only when the window size changes.
matLine.resolution.set( window.innerWidth, window.innerHeight ); // resolution of the viewport
Actually, I do it by simply removing the AxesHelper from the scene, then changing its size and displaying it again.
Here, with a gui-dat panel to change its size:
// AxesHelper
// =============================================================================
const axes = new THREE.AxesHelper;
scene.add(axes); // Size default is 1
let axesHelperParam = {size:1};
function axesHelperResize(size:number) {
scene.remove(axes);
axes.scale.setScalar(size);
scene.add(axes);
render(); // Function to renderer.render on demand
}
const axesFolder = gui.addFolder("Axes");
axesFolder.add(axesHelperParam, 'size', 1, 5).onChange(axesHelperResize);
axesFolder.open();