This week, I wanted to experiment with a draw() animation that does something different depending on where your mouse is on the screen. I also just wanted to play with push/pop matrix, combining loops, mapping, variables, and sin/cos. Here’s the result! browser version | source code
The interface is not intuitive, but here’s how it works:
– The draw function changes depending on where the mouse is on the screen.
– Clicking on the screen translates the center.
– KeyPressed pauses draw. Another press will clear the screen and change background color.
I didn’t want to add a GUI because I wanted the canvas to be a GUI, but I would like to figure out how I could add a temporary shadow over the part of the screen that the cursor is, which could help provide some feedback to the user.
Some more screenshots: