In this week’s assignment, I created a windmill to spin with my hand’s rotation while emitting colorful particles and to stop when my hand stops to rotate. I used KNN classification and “FeatureExtractor” to recognize my gestures – one is hand’s rotation, another one is the resting state of the hand, which is the palm.
For the display of the project, I loaded a PNG picture of “cloud” and another PNG picture of “windmill” to decorate. I also created a class to generate colorful particles. By using the “rotate()”, I managed to make the windmill rotate with my hand. However, at first, there was an issue that the colorful particles were emitted in the same direction. To solve this problem, I put the windmill between the “push()” and “pop()” so that the particles won’t be affected by the “rotate()”.
And the project looks like this:
Code for my project “Windmill”: