Updated codesandbox: model-viewer (forked) - CodeSandbox
The problem is that the MTL contains this statement for the materials diffuse color:
Kd 0.00 0.00 0.00
The consequence of this setting is explained here: OBJLoader + MTLLoader not loading texture image - #4 by Mugen87
For now, I’ve manually resetted the color property
to its original value.
Besides, use OBJLoader
instead of OBJLoader2
(which has been removed with r125
).
new MTLLoader().load(mtlPath, function (materials) {
materials.preload();
new OBJLoader().setMaterials(materials).load(objPath, loadSuccess, undefined, onError);
});
Or even better, use glTF instead of OBJ.