My object separated into 9 files, so I need to load all 9 files: file_1.obj, ..., file_9.obj, merge them all and after that somehow use file.mtl with the result "big" object. How am I suppose to do it?
I thought about this solution:
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);
});
And after that load .mtl file and connect them (even though I don't know how to do it).
But I think that using this technique I can not know the time when all objects are loaded.
How can I solve this problem? And can I connect "mainObjGeometry" and loaded from .mtl "mainObjMaterial"?