After further investigation, it seems that the issue lies with the exported files and their formatting, although I am unsure of the exact problem. Interestingly, additional example models I downloaded render perfectly fine.
I have encountered a problem with Three.js while attempting to load .obj and .mtl files.
The files, consisting of objects and corresponding materials, were exported from 3ds Max by someone else. While I am not a professional 3D modeler, I can request the original creator to re-export the files if necessary.
In my previous uses of THREE.js, I never faced this particular issue. The file loading process involves the following code:
mtlLoader.load("stands/objects/Table&Chairs.mtl", function(materials){
materials.preload();
var objLoader = new THREE.OBJLoader();
objLoader.setMaterials(materials);
objLoader.load("stands/objects/Table&Chairs.obj", function(object){
scene.add(object);
object.position.set(-5, 0, 4);
});
});
Although no errors occur during loading, the object is not visible in the scene. Curiously, replacing the uploaded files with assets from different sources results in successful rendering.
This discrepancy suggests a possible issue with the exporting process of the files.
Screenshot displaying my rendered .obj file
https://i.sstatic.net/43VTR.png
Screenshot showcasing the rendered example .obj file
https://i.sstatic.net/jG9Ky.png
Any assistance in identifying the root cause of this problem would be highly valued.
The objects and materials can be accessed here.
The Table&Chairs files belong to me, while the Tent_Poles_01 files are provided as examples.