My project involves an object that is separated into 9 files, namely file_1.obj to file_9.obj. I need to load all these files, merge them together, and then somehow incorporate the file.mtl with the final "big" object. How can I achieve this?
One possible solution that comes to mind is as follows:
mainObjGeometry = new THREE.Geometry();
loader.load( 'file_1.obj', function ( object ) {
object.updateMatrix();
mainObjGeometry.merge(object.geometry, object.matrix);
});
...
loader.load( 'file_9.obj', function ( object ) {
object.updateMatrix();
mainObjGeometry.merge(object.geometry, object.matrix);
});
After merging all objects, the next step would be to load the .mtl file and somehow connect it to the merged geometry (although the process for doing so is unclear).
However, a concern arises regarding tracking the loading progress of all objects using this method.
How should I address this issue? Is there a way to link "mainObjGeometry" with the material loaded from .mtl?