Hi all, just started using three.js yesterday. My main goal was to load up a model I had created in Blender which I eventually succeeded with. Very nice!!
To get there was a bit of a struggle, I want to go over this journey as I feel the documentation could have been better in regards to this particular task.
To begin with, the Getting Started page is confusing to an absolute newbie as it gives you a single three.js file before the actual installation documentation. It took me some time to understand that there was more to the library than just this file. Not to mention that the documentation encourages using files from the same master version. I don’t believe this part is so bad, but I’m just noting my experience with it. It confused me.
My problem here was that the Loading a 3D Model documentation shows to import “three/examples/jsm/GLTFLoader.js”, however, using the file led to this type error, “Uncaught TypeError: THREE.GLTFLoader is not a constructor”, which if you google has caused some confusion. I found that using the “three/examples/js/GLTFLoader.js” file instead, fixed this error for me and I could see my model.
I understand that this post is a bit trivial, and that I may be wrong about several things in here, but I thought it was worth pointing out from a user experience point of view. I will definitely continue to use three.js.
Thanks for reading.