Harmonic Coordinates for Character Articulation
Some time ago, I took a course on Geometric Modeling. Recently, I was going through my old notes and project, and I thought it would be nice to write a short post about what I built before I completely forget the details. This post is a quick look back at the project from this course and the main ideas I learned along the way.
Modeling a 3D Object
Section titled âModeling a 3D ObjectâHow do we represent 3D objects on a computer? If we want to model a real-world object digitally, a common first step is to capture a point cloud, literally a cloud of points sampled from the objectâs surface. There are a few ways to obtain a point cloud, but the easiest to picture is active sensing: you send out waves, measure the round-trip time, and use that measurement to estimate where a point is in 3D space.
A point cloud is merely a set of points with no notion of connectivity. To turn it into a 3D object, we need to connect the points and reconstruct the surface (a process known as surface reconstruction). The result is typically a mesh with triangular faces. The finer the mesh, the smoother the object appears.

- Image Source: A Surface Displaced from a Manifold
Itâs common to represent a mesh as (V, E, F):
-
V : a set of vertices,
p1 = (x1, y1, z1). -
E : a set of edges,
e1 = (p1, p2). -
F : a set of faces, often triangles,
f1 = (p1, p2, p3).
With these three pieces, we can describe both the geometry (where the points are) and the topology (how they connect).
Once we have a mesh, a lot of interesting problems in geometric modeling boil down to updating V so that the new vertices satisfy some condition. In theory, you could tweak the vertices one by one in a loop, but this is hard to control and slow in Python.
Instead, we usually construct a linear system, Au = b, and solve for the updated vertex positions in one shot i.e., np.linalg.solve(A, b). The difficult part is cleverly constructing A and b so that the solution u actually corresponds to the vertices we want. This idea will hopefully become clearer as you read the rest of this post.
Character Deformation
Section titled âCharacter DeformationâConsider an animated character, say Woody from Toy Story. When Woody lifts his arm or takes a step, a huge number of mesh vertices need to be updated, frame after frame.
This would be a lot easier if, instead of editing the vertices directly, we had a few âknobsâ (control points) that we could move around, and the character would deform smoothly.
This is the idea behind cage-based deformation. We enclose the character in a coarse âcageâ. As the cage deforms, the interior gets warped along with it. Since the cage has far fewer control points than the original mesh, itâs much more efficient and easier to animate.

- Image Source: A Survey on Cage-based Deformation of 3D Models
The tricky part is binding the character to the cage, meaning we need to establish a relationship between the cage control points and the points in the interior. One way to do this is with harmonic coordinates, as described in this paper by Pixar.
For this course, I worked on a mini-project where I implemented a simple 2D demo based on the core ideas from this paper. The rest of this post walks through this project at a high level.
Here is the GitHub repo that contains the code.
Harmonic Coordinates
Section titled âHarmonic CoordinatesâWe start by preparing a simple 2D mesh. I used a drawing tool to sketch a star enclosed by a square-shaped cage. Then I converted the SVG into a mesh using Pythonâs triangle library.

Meshing creates a lot of vertices along the cage boundary, but we want a smaller set of control vertices. Also, while we could manipulate any point inside the cage, letâs just display the ten vertices that make up our star.

Above, I explained hand-wavily that we want to establish a relationship between the cage and the enclosed shape. More concretely, we want to compute a set of weights so that a point p can be written as a weighted sum of the cage vertices. The weights for each p should sum up to 1.
So we are looking for n x m weight values, where n is the number of vertices we wish to manipulate and m is the number of control points. Once we find these weights on the original mesh, we can move the cage vertices, and reuse the same weights to get the updated positions.
Pixarâs paper proposes using harmonic weights, weights computed by minimizing the Dirichlet energy. In practice, this means solving the Laplace equation, which encourages the weights to vary smoothly and produces natural-looking deformations.
Mathematically, the Laplacian of a function is the sum of its second partial derivatives. You can think of it as measuring how much a point stands out compared to its neighbors. So by optimizing this smoothness term, we get a set of weights where no single point changes too abruptly relative to the surrounding area.
In the image below, we see that the weights associated with the red control point vary smoothly, gradually weakening with distance. This matches the intuition that a control point should have stronger influence on nearby interior space.

So how do we compute the harmonic weight matrix H with the shape (#vertices, #control points)?
The most intuitive approach is to build H column by column. In other words, for each control point ci, we compute a (#vertices, 1) vector hi that gives us the weights of ci for every vertex in the mesh.
This is pretty straightforward with the help of existing libraries. igl.cotmatrix(V, F) constructs the cotangent Laplacian L, a sparse (#vertices, #vertices) matrix. You can think of L as encoding a smoothness constraint; for interior vertices, Lh = 0 encourages the value at each vertex to agree with its neighbors.
To compute hi, we can set up a linear system L@hi = b and impose boundary conditions on the cage. Concretely, we âpinâ the cage vertices so that hi(ci) = 1 and hi(cj) = 0 for every other cage control points. In code, this is done by replacing the rows of L corresponding to cage vertices with identity rows, and setting b to the desired values (1 at ci, 0 elsewhere on the cage).
Solving the system gives us weights that satisfy the boundary constraints while staying as smooth as possible in the interior. Repeating this for each control point and stacking the results horizontally gives the full weight matrix H.
def compute_hi(V, F, cage_indices, ci): L = igl.cotmatrix(V, F) b = np.zeros(V.shape[0])
L = L.tolil()
for i in cage_indices: L[i, :] = 0 L[i, i] = 1 b[i] = 1 if i == ci else 0
L = L.tocsc() hi = sp.linalg.spsolve(L, b)
return hi
def compute_H(V, F, cage_indices): H = np.zeros((V.shape[0], len(cage_indices)))
for i, ci in enumerate(cage_indices): hi = compute_hi(V, F, cage_indices, ci) H[:, i] = hi
return HOnce we have obtained H, we can move the cage vertices and apply H to update the inner vertices. Here are the results! - the star gets warped along with the cage.

Walking into this class with no background in linear algebra and differential calculus, I donât think I can fully appreciate the beauty of geometric modeling. But the course really forced me to think about the limits of numerical methods and representations. For example, many operators from differential calculus (like the Laplacian) are defined on smooth, differentiable surfaces, while a mesh is discrete. So applying these operators in practice may not be as straightforward as the math makes it look, and discretization can introduce approximation error. On top of that, numerical precision matters: small errors can accumulate, and solving large linear systems is never perfectly âexactâ on a computer. Linear systems show up everywhere today, from AI to robotics, and I think this course gave me a much better intuition for whatâs happening under the hood and what the real challenges look like.