float frame=0; //global parameter (got it off the last class) void setup() { size(800,450); rectMode(CENTER); //leaving this off would change the pattern slightly smooth(); //just to make it nicer } void draw() { //background(192); //turn this back on to better see the "phases" noStroke(); translate(width/2,height/2); for (int i=0; i<5; i++){ pushMatrix(); rotate(frame*0.0175); myrect(3); //insert myrect() function here with "saiz" parameter set to 3 popMatrix(); translate(-30,0); rotate(frame*0.005); } frame++; } void myrect(int saiz) //the myrect() function { for (int j=0; j<20; j++){ fill (50+frame, 15*j, 10*j); rect(j+3*saiz,j*2,5,saiz*j); rotate(frame*0.00175+0.003); //changing "0.003" to any other number will affect the overall radius translate(10,20); } }