Answer the question
In order to leave comments, you need to log in
Why is the texture not being applied to the model?
I loaded the .fbx model, but it has the path to the default textures (as I understand it). I am getting this error:
HTTP504: GATEWAY TIMEOUT — таймаут запроса в ожидании шлюза.
GET — http://localhost:3000/assets/models/texLOD1_NRM.png
HTTP504: GATEWAY TIMEOUT — таймаут запроса в ожидании шлюза.
GET — http://localhost:3000/assets/models/texMain.png
HTTP504: GATEWAY TIMEOUT — таймаут запроса в ожидании шлюза.
GET — http://localhost:3000/assets/models/tex1.png
HTTP504: GATEWAY TIMEOUT — таймаут запроса в ожидании шлюза.
GET — http://localhost:3000/assets/models/texLOD1.png
HTTP504: GATEWAY TIMEOUT — таймаут запроса в ожидании шлюза.
GET — http://localhost:3000/assets/models/tex1_NRM.png
HTTP504: GATEWAY TIMEOUT — таймаут запроса в ожидании шлюза.
GET — http://localhost:3000/assets/models/texMain_NRM.png
/img/tex1_DSP.png
map-component.tsx (92,1)
/img/tex1.png
map-component.tsx (92,1)
/img/texLOD1.png
map-component.tsx (92,1)
/img/texMain_DSP.png
map-component.tsx (92,1)
/img/texMain.png
map-component.tsx (92,1)
/img/texMain_NRM.png
map-component.tsx (92,1)
load texture: /img/tex1_DSP.png 1 6
map-component.tsx (89,1)
load texture: /img/tex1.png 2 6
map-component.tsx (89,1)
load texture: /img/texMain_DSP.png 3 6
map-component.tsx (89,1)
load texture: /img/texMain.png 4 6
map-component.tsx (89,1)
load texture: /img/texMain_NRM.png 5 6
map-component.tsx (89,1)
load texture: /img/texLOD1.png 6 6
const manager = new LoadingManager();
manager.onProgress = function (item, loaded, total) {
console.log("load texture:", item, loaded, total);
};
manager.setURLModifier((url: string): string => {
console.log(url);
return url;
});
const textureLoader = new TextureLoader(manager);
const vehicleTextureMain1: THREE.Texture = textureLoader.load('/img/tex1_DSP.png');
const vehicleTextureMain2: THREE.Texture = textureLoader.load('/img/tex1.png');
const vehicleTextureMain3: THREE.Texture = textureLoader.load('/img/texLOD1.png');
const vehicleTextureMain4: THREE.Texture = textureLoader.load('/img/texMain_DSP.png');
const vehicleTextureMain5: THREE.Texture = textureLoader.load('/img/texMain.png');
const vehicleTextureMain6: THREE.Texture = textureLoader.load('/img/texMain_NRM.png');
const loader = new FBXLoader();
loader.load(
'assets/models/tesla_ct_export1123.fbx',
(model: any) => {
model.traverse(function(child: THREE.Mesh) {
// if ( child instanceof THREE.Mesh ) {
console.log('texture');
// @ts-ignore
child.material.map = [
vehicleTextureMain1,
vehicleTextureMain2,
vehicleTextureMain3,
vehicleTextureMain4,
vehicleTextureMain5,
vehicleTextureMain6
];
// @ts-ignore
child.material.needsUpdate = true;
// }
});
this.scene.add(model);
}
);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question