After successfully loading an .obj model along with its corresponding .mtl file to correctly map the materials onto the model, I noticed that the loaded model appears very dark. To brighten it up, I attempted to change the emissive color to white but encountered some difficulty in doing so. The code snippet I currently have is as follows:
MTLLoader.setTexturePath( '../models/' );
MTLLoader.setPath( '../models/' );
var url = "model.mtl";
MTLLoader.load( url, function( materials ) {
materials.preload();
OBJLoader.setMaterials( materials );
OBJLoader.setPath( '../models/' );
OBJLoader.load( 'model.obj', function ( object ) {
scene.add( object );
});
});
I also tried implementing the following:
object.traverse (function (child) {
if (child instanceof THREE.Mesh) {
child.material = new THREE.MeshLambertMaterial({emissive: 'white'});
}
});
While this does create an emissive material, it does not take into account the .mtl file. Is there a way to blend both the material settings from the .mtl file and the emissive color change I am attempting? I have not been able to find any information on this issue, and any help would be greatly appreciated. Thank you.