Hello guys.There I get a situation: I use the “mergeBufferGeometries” to merge many lines, but I find them connected one by one, and I want them merged but not connected to each other. So how to figure it out?
const g1 = new BufferGeometry();
const points = [0, 2, 2, 2, 2, 0, 0, 2, -2, -2, 2, 0];
g1.setAttribute(
"position",
new BufferAttribute(new Float32Array(points), 3)
);
g1.setIndex([0, 1, 2, 0, 2, 3]);
g1.computeVertexNormals();
const g2 = new BufferGeometry();
const points2 = [0, -2, 2, 2, -2, 0, 0, -2, -2, -2, -2, 0];
g2.setAttribute(
"position",
new BufferAttribute(new Float32Array(points2), 3)
);
g2.setIndex([0, 1, 2, 0, 2, 3]);
g2.computeVertexNormals();
const g3 = new BufferGeometry();
const points3 = [4, -2, 3, 5, -1, 9, 9, -3, -7, 2, -8, 0];
g3.setAttribute(
"position",
new BufferAttribute(new Float32Array(points3), 3)
);
g3.setIndex([0, 1, 2, 0, 2, 3]);
g3.computeVertexNormals();
const merge = mergeBufferGeometries([g1, g2, g3], false);
const line = new Line(
merge,
new LineBasicMaterial({ color: "white" })
);