Exporting Blender Models For ThreeJS
It's great to play around with ThreeJS, but it doesn't take long before on hits the hurdle of wanting to import and use custom 3D models, rather than ones we create programmatically. This tutorial will show you how one can export a 3D model from Blender into a format that we can then import into our ThreeJS application.
Steps
Open your blender project and click File > Export > gLTF 2.0.
Now you have a choice between exporting everything in one file in binary form (.glb), exporting as a set of files, or exporting as one (.gltf) JSON file with data embedded into the file to make it one file. I prefer to use this last option, but I have tested and used the first one too, which we can import in the exact same way.
Now review the export settings (1), before setting the safe filepath/name (2), and clicking export (3).
You have now exported your model from Blender into a format that we can now import into ThreeJS.
References
- Medium.com - How to Import a 3D Blender Object into a Three.js Project as a glTF File
- marxentlabs.com - Everything You Need to Know About glTF Files
First published: 9th October 2022