import FBXLoader from 'three-fbxloader-offical'; //1.0.0
// import FBXLoader from 'three-fbx-loader'; //1.0.3
Unfortunately these are very out of date and not maintained by us - it’s just random people on NPM who have created these packages. I’ve reached out to them asking them to make it clear that they’re out of date, but had no response.
You’ll need to get the loader from the three.js repo here:
It’s not a module, but it’s pretty easy to convert it to one and there’s lots of info here on the forum on how to do that if you search.
The textures are included separately in the textures/. I haven’t checked to confirm this, but it seems like the textures are not correctly referenced in the FBX file. This is pretty common when downloading files from free model sites like this one.
You have two options: either load up the textures separately and manually apply them to the model, or open the FBX file in a modelling program and fix it.
do we have any documentation on how fbx file should be created, like in structure wise, so that three.js FBXloader can render the file without breaking??
If you import it into any modelling program (such as Blender, 3DS Max), set up the materials, then export it, it should work (animations may take extra work). You may need to check the documentation for the program to see which materials safely export. I would say that the problem in that free3D.com uses a custom FBX exporter that doesn’t handle textures properly. Or maybe the person who uploaded it did not set it up correctly.