You are on page 1of 3

HW4

November 4, 2017
Andrew Emrazian - u0349111
CS 4600 – Computer Graphics

Part 1 – Skeletal Animation


1 void computeJointTransformations(
2 const std::vector<Matrix4f>& p_local,
3 const std::vector<Matrix4f>& p_offset,
4 const std::vector<int>& p_jointParent,
5 const unsigned int p_numJoints,
6 std::vector<Matrix4f>& p_global )

Implementing this function was straight forward. I followed the logic from the lecture slides:

F(j) = R(0) T(0) . . . R(p(j)) T(p(j)) R(j) T(j)


Since we can assume that j < p(j), we can assume that the parent has stored the joint transformations that it is relative
to. The main logic can just be F(j) = F(p(j)) * R(j) * T(j) where F is p_global, p is p_jointParent, R is
p_offset, and T is p_local. See screenshots below to see the skeletal structure and animation.

Part 2 – Linear Blend Skinning


1 void skinning(
2 const std::vector<Vector3f>& p_vertices,
3 const unsigned int p_numJoints,
4 const std::vector<Matrix4f>& p_jointTrans,
5 const std::vector<Matrix4f>& p_jointTransRestInv,
6 const std::vector<std::vector<float>>& p_weights,
7 std::vector<Vector3f>& p_deformedVertices )

Again, I followed the logic from the lecture slides:


m

𝒗𝒗 = � wi F(ji ) A(ji )-1 𝒗𝒗
i=1
The algorithm simply sum the influences that each joint has on the position of the vertex that is in the skin mesh. You
can see the results for the two parts in the images for both the capsule and the ogre below.

1
Capsule

2
Ogre

You might also like