Rigging and Animating a Creature in WebGL – From Blender to a Playable Three.js Game 5 Sections34 LessonsLifetime
Lesson 3: Exporting the GLTF Model
With the creature modelled, rigged, and animated across Lessons 1 and 2, this lesson covers getting it out of Blender entirely, exported into a format a web browser can actually read and display.
What Is GLTF, and Why This Format Specifically?
Blender’s own .blend file format is excellent for editing, but it isn’t something a web browser can open or understand, it’s tied to Blender’s internal data structures. GLTF, short for GL Transmission Format, is different, it’s an open, published standard specifically designed for transmitting 3D models, materials, and animations between different tools, built to be lightweight and fast to load, which matters a great deal for anything running in a browser.
There are two common variants worth knowing about: .gltf, which separates the model data, textures, and binary data into multiple files, and .glb, a single, self-contained binary file bundling everything together. This course uses .glb throughout, one file is simpler to manage and to load in Three.js than juggling several linked files.
GLTF Compared with FBX: FBX is the other format often suggested for moving 3D models between tools, so the choice is worth explaining. Both can carry a mesh, a skeleton and animation, and Three.js can load both. The difference is what each was designed for.
- Purpose: GLTF was designed for delivering 3D to applications at runtime, so that browsers and apps can load it quickly. FBX was designed for moving models between content creation tools and game engines, which makes it more of a working format than a delivery format.
- Ownership: GLTF is an open standard with a published specification, maintained by the Khronos Group. FBX is a proprietary format owned by Autodesk, and not all of its details are open, which is one reason Three.js support for it is less complete.
- File size and loading: GLTF, and GLB in particular, is compact and quick to load. FBX files often come out larger, since they carry data aimed at editing tools that a browser does not need.
- Materials: GLTF uses physically based materials that map directly onto the standard material in Three.js, so a model usually looks much the same in the browser as it did in Blender. FBX materials often need adjusting after loading.
- Support in Three.js: GLTF is the format the Three.js documentation recommends where possible, and its GLTFLoader is one of the best maintained loaders.
This is why the course exports GLB. FBX remains a good choice for other jobs, such as moving models into a game engine, but for a game that runs in a browser GLTF is the simpler and more dependable route.
What This Lesson Covers
- Confirming the model’s starting state
- Testing the walk animation on a temporary floor
- Removing the floor, camera and light from the scene
- Selecting the crab for export
- Choosing the glTF Binary format and the export settings
- Naming the file and exporting it
The Starting Point
Before exporting anything, the model is checked in its current state, confirming the mesh, rig, and animation are all exactly as they should be. A problem found now costs a few clicks to fix, while the same problem found after export means re-exporting from scratch, since a GLB file can no longer be edited the way a Blender scene can.

Testing the Walk Animation
The walk cycle is tested before it goes into the exported file. A temporary floor is added with Shift A, then Mesh, then Plane, and scaled up with S so the crab has ground to walk on. With the viewport back in Solid view and the scene in Object mode, playing the animation shows the crab walking.

The same test with shadows switched on makes it easier to see whether the feet meet the floor properly.

An export does not fail loudly if the animation is broken or missing. It simply exports whatever state the file is in, so it is worth confirming visually rather than assuming.
Clearing the Scene
The floor, the camera and the light were only needed for working in Blender. They are deleted before export, so the exported file holds only the crab. The three.js scene built in the next lesson has its own floor, camera and lights.
Selecting the Crab
This is the most common mistake at export time, worth understanding rather than just following as a step. Blender’s glTF exporter can be set to include only what is currently selected, not everything in the scene. The crab, meaning the mesh and the armature together, needs to be selected. Miss the armature, and the result is a mesh with no rig, so no animation at all. Miss the mesh, and the result is a skeleton with nothing visible attached to it.

The Export Menu
With the crab selected, the export runs through Blender’s built-in glTF 2.0 exporter, found under File, then Export.

File Name
The exported file is given a clear, recognisable name, worth doing deliberately rather than accepting a default. The filename chosen here is the exact string the Three.js project references in code when loading the model, in the next lesson. A mismatched filename at that point produces a loading error that has nothing to do with the code itself.

Format
In the export dialog, the format is set to the single-file glTF Binary option, which produces a .glb file.

Selected Objects
The export is limited to the selected objects, so that only the crab goes into the file.

Animation
The export settings have a large number of options, most of which can stay at their defaults. One matters for this course: the animation must be included. It is entirely possible to export a model that looks correct, with the right proportions and the right pose, and still lose its animation if this option is not ticked, since the mesh and the animation are separate pieces of data that are bundled together at export time.

Exporting the File
With the name, format and settings confirmed, clicking the export button writes the crab and its animation into a single GLB file.

