My apologies if this isn't the right place to ask for help. I'm trying to load up a different mesh and material and I'm having a heck of a time.
loadMaterial = () => {
let mtlLoader = new THREE.MTLLoader();
var path = '../public/models/test/';
var filename = 'test.mtl';
mtlLoader.setPath(path);
mtlLoader.load(filename, materials => {
materials.preload();
this.loadModel(materials.materials.material);
});
};
loadModel = material => {
let dracoLoader = new DRACOLoader('../third_party/draco/', {
type: 'js',
});
dracoLoader.load('../public/models/test/test.obj.drc', geometry => {
//var material = new THREE.MeshStandardMaterial( { vertexColors: THREE.MeshNormalMaterial } );
geometry.computeVertexNormals();
this.setupModel(new THREE.Mesh(geometry, material));
this.setupModelShadow();
this.setupLights();
this.setupReticle();
this.setupModelTween();
this.parseURL();
this.HUD.hideLoadingIndicator();
});
};
All I did was change the path from the Astronaut, but every time I reload the page, the mesh is a random solid color.
I've tried it with multiple meshes and textures that I know work in Blender and Maya. I've poked around the Googles a fair bit, but I'm coming up short. Do I have to do something special with my material that I'm not thinking of? Everything is pretty basic.