Wondering how to combine two buffer geometries into a single THREE.BufferGeometry
in ThreeJS?
var mergedGeometry = null;
geometry = new THREE.CylinderGeometry(10, 10, 10);
if (mergedGeometry === null) {
mergedGeometry = new THREE.BufferGeometry().fromGeometry(geometry);
console.log(mergedGeometry);
}
bufferGeometry = new THREE.SphereBufferGeometry(20, 20, 20);
var mesh = new THREE.Mesh(bufferGeometry, material);
mergedGeometry.merge(mesh.geometry, mesh.matrix);
It seems like nothing is happening with mergedGeometry
. How can we properly merge these geometries?