Rigging and Animating a Creature in WebGL – From Blender to a Playable Three.js Game 5 Sections34 LessonsLifetime
Lesson 1: Modelling and Rigging a 4-Legged Creature
The finished game is already live online at crabrace.culerdamage.com. Open it now to see what you will have built by the end of the course.
This lesson starts from a cube in Blender and builds the crab: the limbs are modelled, the bones are added and named, the mesh is skinned to the bones, and the IK bones are created. The next lesson positions the limbs and animates the crab.

What This Lesson Covers
- Starting with a cube and shaping it into a limb segment
- Building the limbs and fixing the centre of origin
- Joining the limbs and mirroring them with a Mirror modifier
- Adding, naming and mirroring the bones
- Skinning the mesh to the bones
- Parenting the limb bones to the main bone
- Adding the IK bones
Starting with the Cube
Open Blender with the empty scene. Press Shift A and add a cube. This cube becomes the central body of the crab.

In Edit Mode, press 1 for the front view and 3 for the side view. Press S and then Y to stretch the cube along its length. Add a loop cut with Ctrl R and move it to the back, then scale it with S. Add a second loop cut with Ctrl R and move it to the centre, and scale that too. Then reduce the ends with S so the shape starts to look like the position of a bone.
In the Modifiers tab, select the Subdivision Surface modifier to smooth the shape. Select everything and scale it as needed. The result is a small capsule, which is the central body.

Creating the Limbs
The limbs are built from smaller capsules. In the front view, reduce the capsule with S and move it close to the centre with G and then X.
Switch to the side view, press R, X, then -90 and Enter to stand the capsule upright, and move it up with G.
A limb is built from four or five of these capsules stacked upward. Press S and then Z to make the first capsule longer, then G and then Z to bring it up. Press Shift D to duplicate it, and repeat Shift D for each further segment. Reduce each new copy with S, so the capsules get smaller toward the tip of the limb.

Select the whole limb in the front view. In the top view, press Shift D and move the copy back, so there are two sets of limbs, one for the front and one for the back.
Fixing the Centre of Origin
Duplicating the limbs as they are would make it hard to centralise them around the centre. Duplicating an object uses its centre of origin, which Blender shows as a yellow dot, so every object needs its origin at the centre. Delete the duplicated limb that is not centred.
Select everything first, and go to the menu Object, then Set Origin, then Origin to 3D Cursor. All of the objects now have their centre of origin at the centre.

Joining and Mirroring the Limbs
A Mirror modifier added to a single object only duplicates that one object, and the aim is to duplicate everything. So delete it, select all of the objects and press Ctrl J to join them together. Then add a Mirror modifier. The limbs are duplicated to the other side of the body.

Adding the Bones
The bones are added first and named afterwards. Place the 3D cursor at the centre, press Shift A and add a single bone. In the Bone properties, open Viewport Display and turn on In Front, so the bone shows through the mesh.
Press 3 for the side view and move the bone to the back with G. In Edit Mode, select the tip of the bone and press G to bring it to the front. This is the main bone of the character.

Creating the Bones for a Limb
Duplicate the main bone with Shift D in the top view and use it to build the limbs. In the front view, raise the tip of the duplicate with G so it runs up the limb. Right-click it and choose Subdivide to split it into a chain of bones, then subdivide a second time. Adjust the joints with G and then Z, and extrude with E and then Z, until the bones line up with the capsules. Then add the last bone manually, so that each limb has five bones.

Each bone is then named, starting from the spine: select the middle bone and name it Spine. The limb bones use a pattern: limb.F1.L, limb.F2.L, limb.F3.L, limb.F4.L and limb.F5.L for the front left limb. The .L ending is what lets Blender copy the names to the right side later.
To make the back limb, copy the front bones with Shift D in the top view and move the copy back. Rename them in the same pattern: limb.B1.L, limb.B2.L, limb.B3.L, limb.B4.L and limb.B5.L.
Mirroring the Bones with Symmetrize
Press 1 for the front view and select all of the bones except the middle one. Open the Armature menu and choose Symmetrize. The bones are copied to the other side, and the .L endings change to .R. Select a bone on the right side to check, for example limb.F1.R or limb.B3.R.

Skinning the Mesh to the Bones
Skinning makes the bones control the mesh. In Object Mode, select the mesh, then the armature, and then press Ctrl P and select With Automatic Weights.
To test it, go to the front view and into Pose Mode. Select a bone and rotate it. The mesh rotates with it.
Parenting the Limb Bones to the Main Bone
At this point, pressing G on a limb bone does not move the rest of the limb. A single bone at the top is needed to move the whole limb, and the limb bones all need to be parented to the main bone.
In Edit Mode, select the first bone of a limb, then Shift-select the main bone. Press Ctrl P and choose Keep Offset. Repeat this for each of the four limbs. Back in Pose Mode, pressing G now moves the whole set of bones.

Adding the IK Bones
The bones so far use forward kinematics. Pressing R rotates a limb from the shoulder. An IK bone lets the limb be moved from the foot instead.
In Edit Mode, create the first IK bone and name it limb.F.IK.L. The name shows that it is the IK bone for the front left limb. Do the same for the back left limb, and name that IK bone limb.B.IK.L.

In the front view, select the two IK bones and use Armature, then Symmetrize, as before. The right side gets matching IK bones, for example limb.F.IK.R, with the .L ending changed to .R.

