Learn creative coding writing simple programs

29. Rectangle spinning around the mouse pointer

In this episode we finally see how to rotate a rectangle around its own center. We add the fade-out effect to make the rectangle leave a nice blurry trail behind it, and changing just one line we make it spin around the mouse position.
Key ingredients for this episode are rectMode(), rotate() and translate().

Tags: rotate, translate, spinning

Code editor

You can make changes to the code below. Then
Below you can ask and answer questions related to this video. If your question is unrelated to the video, please post it at the Processing Forum as I'm unable to help with all of your programs and still have enough free time to eat and sleep :)
comments powered by Disqus