1

I'm new to three.js and I was following along a tutorial on loading GLTF Models using Three.js. I wanted to practice by using the FBX loader to import and animate models from Mixamo.

The tutorial used CDNs for the three.min.js and GLTFLoader files. I tried doing the same for the FBXLoader. However, I keep getting errors calling the FBXLoader from my main.js file

In my HTML I have:

In my main.js I've tried calling it like so:

const loader = new THREE.FBXLoader();

and

const loader = new FBXLoader();

then get the following respective errors

Uncaught TypeError: THREE.FBXLoader is not a constructor

Uncaught ReferenceError: FBXLoader is not defined

I've messed around with it quite a bit, and tried removing the type "module" and changing "jsm" to "js" with no luck either. (Plus I also encounter a deprecation warning when I do that). I don't have the best understanding of importing plugins from three.js so any clarification would help.

Also, I see that GLTF is the preferred format for Three.js, should I convert my FBX model and animations from Mixamo to GLTF using blender?

Thank you

1 Answer 1

1

Did you try loading the FBXLoader first via script- tag in your html as it must be before instantiating it ? If not, load the .js- version.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.