Page 3: Skinning
Spring 2026 Sample Solution
“Skinning” is one of the most common ways to animate a mesh for interactive computer graphics. It is the standard approach for animating articulated characters (characters, like humans, that have relatively rigid pieces).
It is built into Three.js. Here is the three.js skinning demo (modified by CoPilot to fit in the workbook page):
Three implements the most standard kind of skinning very well, and efficiently. To show off how efficient it is, you can look at the instanced skinning demo which shows many instances of this character, with some fancy lighting.
This demo doesn’t actually show how to do skinning in three.js: it loads the skinning from the model file. On this page, we’ll introduce skinning concepts and describe how they can be implemented in three.js.
A Note on Terminology
The term skinning broadly refers to techniques where an underlying character’s motion is used to control the mesh/surface of a character. Claude defines it as:
Skinning is the class of techniques for deforming a surface mesh in response to the motion of an underlying control structure, typically a skeleton, so that the mesh appears to move as a continuous, flexible skin.
On this page, we are focused on a specific kind of skinning that is commonly called linear blend skinning. Linear blend skinning (LBS) is so common, that when you hear just “skinning” it probably means LBS.
The term Linear Blend Skinning is newer than the technique. Claude (and others) generally credit me (or my 2003 paper by Alex Mohr and me) with introducing the term (although we did not invent the technique). I thought others were using the term, but I think it is fair to say that Alex and I popularized the use of the term. The technique goes back to at least 1988.
You will sometimes hear the method referred to as smooth skinning, although this term is ambiguous (other methods are smooth as well). Other terms include Skeletal Subspace Deformation, Multi-Matrix Skinning, Blended Skinning and Joint-Dependent Local Transformations. I think Linear Blend Skinning is the right balance of being specific and not too hard to say.
What is Linear Blend Skinning?
The idea of Linear Blend Skinning (LBS) is that each body part (called a bone) is represented by a linear transformation. Any vertex is allowed to be connected to multiple bones (or to be moved by multiple transformations). We compute the position of each vertex in each coordinate system, and blend (weighted average) those positions together.
It may be easiest to understand this by comparing it with the alternative: rigid skinning (or normal articulation). In normal articulation (all the things you have made in class so far), each part of the object is in one coordinate system, so every vertex is attached to one coordinate system.
Here’s an example: we’ll make an articulated arm with two pieces. The blue piece is at the origin, the red piece is to the right. In 2D each piece could be a rectangle. I put each rectangle in its own coordinate system:
The blue rectangle is in the blue coordinate system, the red rectangle is in the red coordinate system. I put the center of the red coordinate system in a different place, so when I rotate it, I get an arm-link behavior.
If we had a single mesh of points, we could put any point into either coordinate system. So, each point potentially has two places to go: where the blue transformation takes it, and where the red coordinate system takes it.
With rigid skinning, we assign each vertex to one of the coordinate systems. This effectively mimics the multiple pieces. Although, there is a difference since the vertices are connected, there may be an edge across the gap. Here I picked some vertices to be blue, some to be red. I’ve marked the edges that connect red to blue in green.
Notice that I chose to make the center bottom point a blue point. I could have chosen red for it.
The idea of linear blend skinning is that we don’t have to choose which coordinate system a vertex belongs to: we can allow it to be in both. We can blend (take the weighted average) of the different choices. Let’s focus on that bottom center point. It could go to two different places (red or blue). Or, we can blend (average) those points together and make the point go to any place along the yellow line.
We choose weights for the vertex to say how much each of the coordinate systems it uses. For example, we might say that this vertex should be 50% red and 50% blue, which means its position would be half-way in between.
Notice that rigid skinning is a special case of linear blending where the weight is 100% for one transformation, and 0 for the others.
Also, in this case we only have two transformations. We could have allowed each vertex to be in many different transformations, and have a blend weight for each of them.
The key to linear blend skinning is that we need to assign each vertex a set (vector) of weights that say how much each transformation affects it. This is an artistic authoring challenge: an artist needs to design the weights so that the mesh moves nicely as the underlying coordinate systems change.
We often call the transformations bones. The bones don’t have geometry - they are just transformations that move part of the character around.
I have described this as computing the position of the vertices for each bone and then blending it. However, because the operations are linear, it is equivalent to blend the transformations and apply them to the vertices. This is the more common way to implement it. The equivalence will make sense when we introduce the math. I think blending points is an easier way to understand what is going on.
Does this work?
Here is a demo that takes that two piece example into 3D (using three’s implementation) - you can switch between a cylinder and a box:
Use “elbow angle” to bend the arm. Start by picking rigid mode. Here you can see each vertex is assigned to either blue or red. As you bend the arm, things stay connected, but the change is abrupt and the top folds inside of the bottom (evidence of Z-Fighting!).
If you switch to smooth mode, the box looks like it bends. Because of the way that the weights are assigned (I let an AI agent pick the weights), it bends a lot. But this is the idea: rather than the abrupt switch of rigid where we jump from one piece to the next, we get a graceful transition controlled by how quickly the weights change.
You can see one of the problems: as things bend, the elbow “pinches” (it gets narrower). This is a problematic artifact of linear blend skinning. It is difficult to avoid (for reasons that will make sense when we describe the math).
There is another variant of this pinching problem: straighten the elbow and try twisting (the “twist slider”). Notice how we get extreme pinching like a candy wrapper. This is called the candy-wrapper effect.
While these artifacts are unavoidable, they primarily show up in extreme cases. Notice how in the dancing demo, things look OK. Here we show LBS and rigid skinning side by side:
Look carefully at a joint that bends a lot (like the knees). You’ll see a difference in smoothness.
Where do weights come from?
A key trick in using skinning is determining the weights. The ability to control the outcome is both a benefit and a problem. The ability to set weights for every vertex gives a lot of artistic control; however, it can be tricky to achieve desired effects.
Here are some examples with the two link arm. You can see the weights by the color: blue is the top coordinate system, red is the bottom, and the magenta middle is where we have some of each.
Notice how on the left, we make a smooth transition over the whole object from 100% red to 0% red (100% blue) at the top. This looks very bendy. On the right, the transition is abrupt (everything is on one bone or the other). In between there are different amounts of gradual transitions.
The different weightings also show different artifacts: the more rigid weights give more foldover, the bendier weights show more pinching. The choice of weights can consider what looks good and bad, given the expected motions.
Determining the skinning weights is an artistic problem, and it is often done manually by an artist.
The Steps
In order to make skinning work, we need to follow a sequence of steps that we will detail in a bit:
- We need to start with a mesh.
- We need to define the set of coordinate systems. We call each coordinate system a bone, and the set of coordinate systems a skeleton. Note: we can use any coordinate systems, but we often prefer to use a hierarchy of rigid transformations.
- We need to find an initial configuration of the coordinate systems so that it aligns with the mesh. This is called the binding pose. This lets us know how the mesh relates to the skeletons.
- We need to assign weight values for each vertex that specify how much each coordinate system affects it. This is called weighting.
- We need to do an initial pre-computation that figures out where the points are in the various coordinate systems. This is called binding.
- Then, when we draw, each vertex figures out where it is in the various coordinate systems (based on its binding), figures out where that transformation takes it, and blends those positions together based on the weights.
The importance of the binding step will make more sense once we see the math.
The Math
Even if you never have to implement linear blend skinning (because the API takes care of it for you), it is useful to see the math because it will (1) make it clear why the artifacts happen and (2) will explain a non-obvious step in the process (that is required in most APIs).
Let’s go back to the simple single point.
Let be the position of our vertex, and and be the transformations of our two coordinate systems (1 for blue, 2 for red). We can compute where ends up in both coordinate systems and blend it together:
Where w are are the weights.
This simple version is good enough to let us understand the complications.
First, we have a problem in lines 1 and 2 (of equation group 1): they both refer to the same , which is the position of the vertex in the original mesh (in the mesh’s original coordinates). This isn’t the coordinate system that necessarily acts on. Therefore, we need to convert from the mesh’s initial coordinate system to the correct coordinate system (the coordinate system of the bone when the skeleton is posed to fit the mesh).
The configuration of the bones (with their coordinate systems) to fit the initial mesh is called the binding pose. And a way to think about it: we bind (attach) the skeleton to the mesh in this pose, and then move the skeleton to move the attached points around.
In the diagram: we can think about the left picture as the initial mesh. We can let the blue coordinate system be the “base” coordinate system of the mesh. The red coordinate system (where the right part of the arm will be attached) has its origin translated to the right in this binding pose. Let’s call that transformation - the binding matrix (for bone 2). This would move points from the coordinate system into the base coordinate system. Since we have the point in the base coordinate system and want it in the local coordinate system of the bone, we use its inverse, .
So the correct skinning equations become:
Let me re-write that all as one equation so it is easier to see the structure of the equation:
When I write it this way, it is easy to see that I can take advantage of the fact that matrix/vector multiplication is associative and distributive to re-write it as:
This should make it clear that we are adding matrices together (taking a linear combination of them). You hopefully remember that adding matrices together is generally not a good way to combine transformations. If you add two rotation matrices together, you don’t get a rotation (even after scaling things back). This is the mathematical explanation for the pinching and candy-wrappering artifacts. For example, if we blend a 180 degree rotation with a 0 rotation, things collapse (the candy-wrapper effect):
That said, for smaller angles, and carefully chosen weights, linear blend skinning can achieve good results even if, in theory, it breaks a lot of rules.
Linear blend skinning (equations 3 or 4) is really simple and therefore, it is efficient and (relatively) easy to implement. There are fancier methods that have fewer artifacts, but in practice, they are not used as often.
Understanding the Binding Pose
The concept of the binding pose is critical to being able to use skinning.
The initial mesh has the character in some pose. We call this the binding pose. We need to know where the skeleton would be inside of the mesh, otherwise we would not know how to attach the points appropriately.
T-Pose (left) and A-Pose (right) are the two standard poses used to model characters. No matter what pose the mesh is defined for, a bind pose skeleton is placed so that the mesh points are properly attached. Here we highlight that the left arm (right side) has a different coordinate system, although the geometry it contains is similar. Figure by Gemini edited by Gleicher.
Once the binding pose skeleton is defined, the weighting process assigns weights for each vertex to specify the amount that each bone influences it.
Practical Issues in Linear Blend Skinning
In principle, linear blend skinning is very general: each “bone” can be an arbitrary transformation (as long as it has an initial coordinate system defined), and each vertex could have a weight for all of the bones.
In practice, most systems limit the number of bones that can influence any particular vertex. For example, in three.js a vertex can only depend on a maximum of 4 bones.
Skinning in Three.js
Three.js has an implementation of linear blend skinning that is relatively easy to use. We still need to perform all of the steps of skinning.
- Make a mesh.
- Define the skeleton as a list of coordinate systems.
- Add skinning data (indices and weights).
- Bind skeleton and mesh.
- Update the positions of the bones to animate the mesh.
We’ll walk through the process with this simple example:
1. Mesh Definition
Any mesh can be connected to a skin. In this demo, we’ll use a cylinder. The bone weights will be added later as extra attributes.
|
|
2. Create Bones And Skeleton
Bones are special objects in three.js. They are similar to other objects in that they have transformations and can be connected to make a hierarchy. They don’t have any geometry themselves. The lines we see in the demo are special “helper” objects that make the bones visible.
For this demo, we create two bones and assemble them into a hierarchy. We position the centers of the bones where they need to be inside of the mesh. In this case, we can use the bones in the default orientation.
We create a root bone and a child bone, place them, and build a THREE.Skeleton from the two-bone array.
|
|
Note: the Bone objects must be added to the scene. In the demo, they are added later (they are made to be a child of the mesh).
3. Define Skinning Data (Indices + Weights)
We need to define the weights for each vertex. In three. this is represented using two attributes of our mesh:
- The
skinIndexattribute that is a vector of 4 integers saying which bones are used for the vertex. The integers are indices into the Skeleton (array of bones). - The
skinWeightattribute that is a vector of 4 floating point numbers that give the weight for each of those 4 bones.
In the demo, the indices are the same for all of the points (there are only two bones) (line 68). The code computes the weight by using the height so that the bottom of the cylinder is 100% of bone 0 and the top is 100% of bone 1 by introducing the variable t that goes from 0 to 1 (line 62-65). The weights are put into a 4-vector (we add zeros for the bones that aren’t being used).
The way the code is written, we loop over all the vertices and create JavaScript arrays that are later converted to BufferAttributes.
|
|
Notice that when we turn the arrays into attributes we must convert them to the special typed arrays that the graphics hardware can accept. We also need to declare that the arrays have 4 numbers per vertex for the skinning information (lines 76-77). We also use the skin weights to set the per-vertex colors (but that is 3 numbers per vertex).
4. Bind The Skeleton To The Mesh
A three.js SkinnedMesh is similar to a regular Mesh except that in addition to Geometry and Material it also uses a skeleton which is added by the bind method.
The key steps are: create THREE.SkinnedMesh, attach the root bone to the mesh, then call bind.
|
|
5. Animate the bone
In the demo, we animate the bone by connecting the orientation of the bone to a slider. But, basically, we can animate the bone like we animate any other object’s transformation. The only difference is that rather than just moving the object, it moves the mesh that is attached to it.
|
|
Common Mistakes
-
The child joint is placed at the wrong location. If
childBone.positiondoes not match the intended joint position, bending appears to happen around the wrong pivot. -
Missing skin attributes. If
skinIndexorskinWeightis not created and attached to the geometry, the mesh will not deform correctly. -
Weights do not sum to 1. When influences are unnormalized, motion can look collapsed or exaggerated. For two-bone blending, check that .
-
Too few height segments. A mesh with very low vertical tessellation behaves like a rigid object even when skinning math is correct.
-
Forgetting to bind the skeleton. You must call
skinnedMesh.bind(skeleton)after attaching bones, or bone transforms will not drive the mesh as expected.
Skinning Summary
Skinning, specifically linear blend skinning, is the standard method used to animate meshes for articulated characters. It is mathematically simple, effectively allowing us to place each vertex in multiple coordinate systems and then blending between these. The mathematical simplicity makes it efficient, but it also means that it is prone to artifacts. The artistic process involves determining the initial configuration of the underlying skeleton and the weights of how much each bone influences each vertex. Three.js has an implementation of linear blend skinning.
Next: Page 4 - Morphing (Blend Shapes)