Here’s my assignment using an add-on and a class. I am still really struggling with openFrameworks, and this turned out to be much more complicated than I expected. When I finally found an add-on that I could get working ok—openCV is one of the add-ons that comes with openFrameworks—it took a long time to figure out what I could manipulate and how. One obstacle was getting the update() function in the class (which I eventually abandoned). Originally I was hoping to have the update field in the class itself respond to the user to change the face from happy to sad and back, but I wound up having to put that in the main testApp file, so that it could use global variables. The movement is very herky-jerky, but I’m not sure of the best way to make it smoother. I also wasn’t able to get the happy/sad change to respond to a mouse-click. The non-working, commented-out code is included.
Code is on Github here, and the video is here: