javascriptthree.jsbounding-box

Three.js thicker BoxHelper


I created a THREE.BoxHelper like so:

let bbox = new THREE.BoxHelper(object, 0xff0000);
scene.add(bbox);

When I load this up, it looks as expected:

img

The only thing that I would want to do is make the lines a little thicker. I am aware that this is not directly possible because they are set to 1px, but I am looking for the quickest way I could do this.


Solution

  • Out of the box, you cannot modify the thickness of a BoxHelper. As others have stated, the default WebGL Line is limited to 1 pixel, and that cannot be changed outside of the box.

    You'll want to look at setting up your own helper, rather than using the standard BoxHelper. Here's a good example! https://threejs.org/examples/?q=line#webgl_geometry_extrude_splines

    Good luck.