I want to have a constant line-width regardless of camera distance in LineBasicMaterial,
is there an option to do that? Because I see in the documentation there is a limitation regarding that.
Due to limitations of the OpenGL Core Profile with the WebGL renderer on most platforms line-width will always be 1 regardless of the set value.
In the example you gave the author used āLine2ā which is from jsm library, which element I need to use to draw a simple line like that just using threeJS?
@Mugen87
Iām trying to build a single Line2 geometry based on the demo you gave, but I donāt succeed giving a single Line (link) geometry between two nodes.
No matter what I put in āpositionā it doesnāt really draw a line.
Can you please help me? Here is my code:
const geometry = new LineGeometry();
var color = new THREE.Color();
var colors = [color.r, color.g, color.b];
geometry.setPositions([
-10, 0, 0,
0, 10, 0,
10, 0, 0
]);
geometry.setColors(colors);
var matLine = new LineMaterial({
color: 'red',
linewidth: 20, // in pixels
vertexColors: true,
//resolution: // to be set by renderer, eventually
dashed: false
});
var line = new Line2(geometry, matLine);
line.computeLineDistances();
line.scale.set(1, 1, 1);
return line;