Three js line thickness

1.9k Views Asked by At

I am using three js and need a way to draw lines that have a thickness greater that 1px. Whenever I use LineBasicMaterial and try to change the lineWidth property, nothing happens. There is already a reason related to Windows Chrome versions so I am asking if there are any good, working alternatives that can help me achieve thick lines.

Here is the material:

const material = new THREE.LineBasicMaterial({
        color: "red",
        lineWidth: 20
});
1

There are 1 best solutions below

0
AlirezaBest1111 On

https://threejs.org/docs/#api/en/materials/LineBasicMaterial.linewidth
As in the above link said :
.linewidth : Float Controls line thickness. Default is 1.

Due to limitations of the OpenGL Core Profile with the WebGL renderer on most platforms linewidth will always be 1 regardless of the set value.