For this week's homework assignment, we will be implementing a bit of skeletal animation. This includes:
For the parts that go in the shader, a good reference is the vertex shader used by the Tiny character in our game projects (MultiAnimation.fx).
The goal is to implement simple skinning with two root bones. It is not necessary to implement a hierarchy, just the two root bones will suffice.
In order to do this, you might want to generate a teapot mesh (or a cylinder or an elongated sphere), assign the pivot point for both of the bones to the origin, and map the bones along opposite ends of one of the three principal axis, such that any vertex within some range of the origin will receive weights that are proportional to the distance along that axis. For instance, all vertices with positive X coordinate get assigned to one bone, and all vertices with negative X coordinate get assigned to the other.
There's no need to do weighting. It's enough if each vertex is assigned to only one bone. But I do require that you add the bone selection informationto the vertices. For two bones like this, it can be a simple value that can be zero or one, or it can be a weight for one of the bones (the weight corresponding to the other bone can be calculated in the shader because all weights must add up to 1).
You must send to JCAB your entire game project source according to the instructions. Using subversion is very much appreciated.
Extra grade will help you compensate your grade if you don't manage to successfully complete one or more basic assignments.
I'll be granting extra grade as follows:
Download it here.