Fun programming A grid of rotating objects creates a wave of rectangles
528 2021-07-19 Download
This is the second time we create a grid of objects.
In the previous episode we used a while loop inside a while loop. Those loops increased two variables which were used to place rectangles in the screen.
In this episode we use again two nested while loops, but instead of counting pixels to fill the whole screen, we count how many rectangles we want to draw. Then we use a function from previous episodes that creates rotating rectangles.
We try different things: all rectangles rotating with exactly the same angle, using a different angle for rectangles depending on the column, depending on the row, and finally we give a different rotation angle for each rectangle in the screen depending on the column, the row and a variable that constantly increases to make them spin.
Courtesy of Abe Pazos Solatie(Fun Programming)
Abe Pazos Solatie, artist and creative coder producing static, moving and interactive images with a focus on the subtle and the organic.