Faced with the problem of texturing models. If i texture ordinary objects, there are no problems, but if the models are loaded from outside, it does not work. Models are loaded, but when I texture, problems start :c What could be the problem? I will be grateful for any answers. Thank you in advance
//if i texture the obj model doesn't work
let loader = new THREE.TextureLoader();
let texture = loader.load('texture.png');
const material = new THREE.MeshPhongMaterial({
map: texture
});
this.objLoader.load('model.obj', (model) => {
let modelTextured = new THREE.Mesh(model,material)
scene.add(modelTextured);
});
//if i texture primitive objects it works
let loader = new THREE.TextureLoader();
let texture = loader.load('texture.png');
const material = new THREE.MeshPhongMaterial({
map: texture
});
let geomentry = new THREE.BoxGeometry(10,10,10);
let cube = new THREE.Mesh(geomentry,material);
scene.add(cube);