I'm currently working on creating a dynamic 3D coordinate system using the Three.js library. My goal is to add some thickness to the axes, which I've been able to achieve by adjusting the LineBasicMaterial's linewidth parameter.
The code snippet below is functioning well for me as I am not using Windows:
var scene = new THREE.Scene();
var camera = new THREE.PerspectiveCamera( 75, window.innerWidth / window.innerHeight, 0.1, 1000 );
var renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
document.body.appendChild( renderer.domElement );
var triad = new THREE.Geometry();
triad.vertices.push( new THREE.Vector3( 0, 0, 0 ) );
triad.vertices.push( new THREE.Vector3( 10, 0, 0 ) );
triad.vertices.push( new THREE.Vector3( 0, 0, 0 ) );
triad.vertices.push( new THREE.Vector3( 0, 10, 0 ) );
triad.vertices.push( new THREE.Vector3( 0, 0, 0 ) );
triad.vertices.push( new THREE.Vector3( 0, 0, 10 ) );
var line_mat = new THREE.LineBasicMaterial({'linewidth': 3});
var frame = new THREE.Line(triad, line_mat, THREE.LinePieces);
scene.add( frame );
camera.position.z = 40;
function render() {
requestAnimationFrame(render);
frame.rotation.x += 0.1;
frame.rotation.y += 0.02;
renderer.render(scene, camera);
}
render();
However, there seems to be an issue with setting the linewidth on Windows due to the ANGLE library, as discussed in this question: Thickness of lines using THREE.LineBasicMaterial
Could you suggest any workarounds that would allow me to display this correctly on a Windows operating system?