Draw line between 2 points

Since after Three.js´s latest release there´s no Geometry anymore: How would I do same same now:

geometry = new THREE.Geometry();
geometry.vertices.push(new THREE.Vector3(0, 0, 0)); //x, y, z
geometry.vertices.push(new THREE.Vector3(450, -800, 0));
/* linewidth on windows will always be 1 */
material = new THREE.LineBasicMaterial( { color: 0x0000ff, linewidth: 5 } );
line = new THREE.Line(geometry, material);
scene.add(line);

?
B

Maybe this would help? In this specific case BufferGeometry.setFromPoints may be exactly what you’re looking for.

1 Like