Recitation 5–Processing Basic–Ketong Chen

I found this images from  Victor Vasarely

I chose this because it gave me a sense of dizziness and I feel like I will be dragged into the image. And the colors it chooses are very beautiful. Aso, the center of the squares are all in the middle of the center of the image.

In order to create an image like this, I need to figure out how to rotate the squares in the same angle and find the same color. Here is my work:

 I fail to keep the center of the square at the same point which is the center of the image. I tried the translate() function but it did not work well for me. Here is my code:

size(600,600);
background(126,70,66);
noStroke();
rotate(-PI/144);
fill(78,59,55);
rect(20,20,560,560);
fill(55,50,52);
rotate(-PI/144);
rect(40,40,520,520);
fill(78,59,55);
rect(60,60,480,480);
rotate(-PI/144);
fill(122,69,63);
rect(80,80,440,440);
rotate(-PI/144);
fill(185,69,69);
rect(100,100,400,400);
rotate(-PI/144);
fill(203,65,73);
rect(120,120,360,360);
rotate(-PI/144);
fill(207,110,122);
rect(140,140,320,320);
rotate(-PI/144);
fill(219,135,138);
rect(160,160,280,280);
rotate(-PI/144);
fill(241,173,163);
rect(180,180,240,240);
rotate(-PI/144);

I think processing can help us to create countless shapes and combine them together to form a new shape which is a really useful tool. But you need to do a lot of calculation and be familiar with the code which is a long way to go for me.

Leave a Reply