Sorry my eng not that good.
So i created pattern with my own function and than used loop (i think u dont understand so just try my code)
float a=0.0;
int x = -20;
int y = -20;
int rad = 50;
int dod = 50;
void setup() {
size(500, 500);
}
void draw() {
noFill();
while (x>520);
{
drawPattern(x, y, rad, rad);
drawPattern(x, 30, rad, rad);
drawPattern(x, 80, rad, rad);
drawPattern(x, 130, rad, rad);
drawPattern(x, 180, rad, rad);
drawPattern(x, 230, rad, rad);
drawPattern(x, 280, rad, rad);
drawPattern(x, 330, rad, rad);
drawPattern(x, 380, rad, rad);
drawPattern(x, 430, rad, rad);
drawPattern(x, 480, rad, rad);
x=x+50;
}
}
void drawPattern(int x, int y, int rad, int rad2) {
strokeWeight(2);
ellipseMode(CORNER);
stroke(0, 0, 255);
ellipse(x, y, rad, rad);
ellipseMode(CENTER);
stroke(255, 0, 0);
rect(x, y, rad, rad);
stroke(0, 255, 0);
ellipse(x+50, y+50, rad/2, rad2/2);
}
SOOO now i need to Increase the initial size of the pattern until
the radius will not be 4 times larger than the original
this is an example of how my pettern should move
int x = -20;
int y = -20;
int rad = 50;
float a=0.0;
void setup() {
size(500, 500);
}
void draw() {
noFill();
background(0);
translate(0, 0);
scale(sin(a) + 2);
strokeWeight(2);
ellipseMode(CORNER);
stroke(0, 0, 255);
ellipse(x, y, rad, rad);
ellipseMode(CENTER);
stroke(255, 0, 0);
rect(x, y, rad, rad);
stroke(0, 255, 0);
ellipse(x+50, y+50, rad/2, 25);
a += 0.1;
}
i hope u will help me