Hello!
So I’m trying to take a bunch of objects that are in a loaded gltf scene and merge them together. The objects are scattered around the scene. When traversing the gltf, I push all the meshes into an array, and then try to do this:
if (meshes.length) {
let mergedGeom = mergeBufferGeometries(meshes.map(m => m.geometry.clone().applyMatrix4(m.matrixWorld)), true);
let mergedMesh = new THREE.Mesh(mergedGeom, meshMaterial);
// just some arbitrary coords so that I can see the mesh immediately after loading the test scene
mergedMesh.position.x = 11.1863;
mergedMesh.position.y = 0.5;
mergedMesh.position.z = -15.0943;
scene.add(mergedMesh);
}
Similarly to how it was advised by Mugen87 here.
Unfortunately, the objects appear to be all in one place. Am I missing something here?