Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Three.js LineBasicMaterial linewidth issue

Tags:

three.js

webgl

When I working with CanvasRendereer then linewidth of LineBasicMaterial working fine but when I switch to WebGL then its not working only default linewidth is applied in material. I found some post regarding this issue and I got idea that its not working in windows for ANGLE issue.

Is this problem still there?

If this problem is solved then how to use it or if not solved then is there any other way to implement linewidth in WebGL?

Thank you.

like image 266
Shiladittya Chakraborty Avatar asked May 20 '26 14:05

Shiladittya Chakraborty


1 Answers

WebGL does not support line width for three js

See https://threejs.org/docs/index.html#api/geometries/TubeGeometry

WebGL renderer on Windows platforms linewidth will always be 1 regardless of the set value.

You could use TubeGeometry

https://github.com/jjcc1421/Three3DExtras

var line=new three3DExtras.tubeLine([-1,-1,0],[1,1,0],0.02,'#FFF');
var line2=new three3DExtras.tubeLine([-1,0,0],[1,0,0],0.02,'#E3DC1C');
var line3=new three3DExtras.tubeLine([-1,0,1],[1,0,1],0.02,'#B02735');
scene.add(line.getObject3D());
scene.add(line2.getObject3D());
scene.add(line3.getObject3D());
like image 106
Juan Caicedo Avatar answered May 24 '26 07:05

Juan Caicedo