Practical sessions
Try out these ideas to get a deeper insight into vertex skinning:
- Implement dual quaternion skinning also on the CPU side. This is simpler than the GLSL variant because you can use the quaternion and dual quaternion data types of GLM in the code, and do not have to convert them to 2x4 matrices. Compare the timings with the normal CPU vertex skinning.
- Adjust the vector normals in the shader to follow the changes in the vertices. Right now, the vertex normals are copied unchanged to the fragment shader, and the normals are not altered when the model triangles are rotated. This leads to incorrect lighting on the model as the direction of the normal and the direction of the triangle no longer match. Hint: use the transpose of the inverse matrix.
- Clean up the renderers and remove the box model data. In the next chapter, we will fully concentrate on character animations, and the boxes will most probably obstruct the exploration of the animations.