Capítulo 813 de 859
How to draw a plain line (not a wireframe mesh) using LineBasicMaterial or LineDashedMaterial combined with a geometry made from an ordered list of vertices.
LineBasicMaterial / LineDashedMaterial: the two material types for line rendering; a regular mesh material won't work.Line object: combines a geometry and a line material, and is added to the scene the same way a Mesh is.const material = new THREE.LineBasicMaterial({ color: 0x0000ff });
const points = [
new THREE.Vector3(-1, 0, 0),
new THREE.Vector3(0, 1, 0),
new THREE.Vector3(1, 0, 0),
];
const geometry = new THREE.BufferGeometry().setFromPoints(points);
const line = new THREE.Line(geometry, material);
scene.add(line);
LineBasicMaterial or LineDashedMaterial, not a regular mesh material.Line object (geometry + line material) is added to the scene exactly like a Mesh.