I recently downloaded a free 3D model and I'm attempting to view it using three.js. Although the model is loading correctly, there seems to be an issue with the materials not loading properly. Strangely enough, only the wine bottles behind the bar are displaying textures, while nothing else in the scene has any texture applied.
Click here to see an example of the issue
This is the code snippet I am using to load the 3D model:
// Loading the bar 3D model
var mtlLoader = new THREE.MTLLoader();
mtlLoader.load( 'bar1/3d-model.mtl', function ( materials ) {
materials.preload();
var objLoader2 = new THREE.OBJLoader2();
objLoader2.setMaterials( materials.materials );
objLoader2.load( 'bar1/3d-model.obj', function ( event ) {
scene.add( event.detail.loaderRootNode );
}, function() {
// success
}, function() {
// error
});
});