I created a simple framework to animate a hierarchical model built with OpenGL. Then, I built a hierarchical model that uses the framework and animated it. Only one animation can be active at a time. If the user tries to start another animation while another one is running, the user input gets ignored.
Animation Class
The framework contains an Animation class, which takes in a vector of figures and an array of increments. It uses linear interpolation to move between different poses of a hierarchical model
Figures
A single figure is one pose of the hierarchical model, which is defined by a struct. The vector of figures describes the order that the poses should be animated in.
Increments
The array of increments specifies the number of frames desired between two figures. For example, the number of frames specified in index 0 of the increments array specifies the number of frames between the model in index 0 and the model in index 1 of the vector of figures. The bigger the number of frames, the longer it will take the program to move from one pose to another.
Controls for My Project
The animations are activated by keypresses as specified below:
'I' - activates a head nod animation.
'U' - activates a fist pump animation.
'O' - activates a happy feet animation.
Demonstration
What I Learned
C++ doesn't have reflection which is really annoying when you're doing the same operation on different variables within a struct or class.