I'm trying to draw lines on a face in three.js
Everything's working fine except the lines are barely visible - no matter how thick I make them: they look like this:
The code that draws the line is:
var lgeometry = new THREE.Geometry();
var lmaterial = new THREE.LineBasicMaterial( { color: 0xffffff, linewidth: 4 } );
var v1 = p1;
var v2 = p2;
lgeometry.vertices.push(v1);
lgeometry.vertices.push(v2);
console.log(lgeometry);
var line = new THREE.Line( lgeometry, lmaterial );
scene.add( line );
I suspect that - since the lines are exactly on the surface, they don't get rendered (is this what the call z-fighting?)
Is there a way to solve this?
I am considering:
- drawing cylinders or other shapes instead of lines
- drawing the line barely above the surface along normals
Any advice or direction to move in?