Learn creative coding writing simple programs

28. Rotate and even move your axes

There are two things we have assumed to be true since the first episodes: when we increase the X coordinate things get drawn more to the right, and the pixel 0,0 is at the top left corner of the display.
We now discover that the X axis does not always point to the right: if we call rotate() the X axis can point anywhere, like the needles of a clock. We could turn our graphics up side down using rotate().
We also discover that we can move the axes. If we do, the 0, 0 point is no longer at the top left corner of the screen.
We show that adding just one line in our program to the beginning of our draw() function we can create drawings that rotate around the center of the screen, instead of rotating around the top left corner.

Tags: rotate, translate

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