Threejs rendering an FBX Object not working. - undefined 404 (Not found)

454 Views Asked by At

I have a set of .fbx objects that I'm trying to load through FBXLoader on a WebXR App.

window.fbxLoader.load("/assets/modelate_FBX/Vaza%208067134/Vaza 8067134.fbx", function( object ) {
    const flower = this.scene.children.find(c => c.name === 'sunflower');
    window.sunflower = this.scene;
});

The problem is that whenever i try running the app, I get the following console error:

undefined:1 GET http://localhost:8887/assets/modelate_FBX/Vaza%208067134/undefined 404 (Not Found)

I am pretty sure the object path is right, as I previously managed to render GLtf files. But I need to render the FBX aswell.

I'm expecting the need to define a path for the texture models. But to be honest I'm kinda lost.

1

There are 1 best solutions below

13
On

Never define your object path as localhost! This will never work. Instead, but you path as /assets/modelate_FBX/Vaza%208067134/Vaza 8067134.fbx.

Here is how youFBXLoader would work:

window.fbxLoader.load("/assets/modelate_FBX/Vaza%208067134/Vaza 8067134.fbx", function( object ) {
    const flower = this.scene.children.find(c => c.name === 'sunflower');
    window.sunflower = this.scene;
});