I’ve just followed this fat line tutorial from threejs examples
https://github.com/mrdoob/three.js/blob/master/examples/webgl_lines_fat.html#L105
However, when setting the code the line gets rendered as following:
const newBox = mesh.geometry.clone();
const edges = new THREE.EdgesGeometry(newBox);
const lines = new THREE.LineSegments(
edges,
new THREE.LineBasicMaterial({ color: "red" })
);
scene.add(lines);
lines.applyMatrix4(mesh.matrix);
lines.updateMatrix();
const pos = lines.geometry.attributes.position;
const geoLine = new LineGeometry();
geoLine.setPositions(
(pos.array as Float32Array).slice(0, 6)
);
const matLine = new LineMaterial({
color: 0xffffff,
linewidth: 1, // in world units with size attenuation, pixels otherwise
vertexColors: false,
dashed: false,
alphaToCoverage: true,
});
const line = new Line2(geoLine, matLine);
line.computeLineDistances();
line.scale.set(1, 1, 1);
scene.add(line);
what I said ………
New contributor
Voy Hexag is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.