In Review

In this tutorial, you have learned the following:

Further Study

Try doing these things with the given programs.

  • In the Translation tutorial, we had two objects that rotated around a specific point. This was achieved by computing the offset for the rotated position on the CPU, not through the use of a rotation transformation. Change this code to use rotation transformations instead. Make sure that the orientation of the objects do not change as they are being rotated around; this will require applying more than one rotation transformation.

  • Reverse the order that the two rotations on the wrist are applied in the Hierarchy tutorial. Note how this affects the ability to adjust the wrist.

  • Reimplement the Hierarchy tutorial, instead using a more generic data structure. Have each node be a struct/class that can be attached as a child to another node. Each node has one parent, but multiple children. The scene will simply be the root node: the node that has no parent. The individual angle values should be stored in the node object. The node should have a render function that will render this node, given the matrix stack. It would render itself, then recursively render its children. The node would also have a way to define the size (in world-space) and origin point of the rectangle to be drawn.

  • Given the generalized Hierarchy code, remove the matrix stack. Use matrix objects created on the C++ stack instead. The node render function would take a const& to a matrix rather than a matrix stack reference.

Fork me on GitHub