Procedural Motion
int d=50;
int x;
int y;
int x1, y1;
float angle = 0.0;
float offset = 60;
float scalar = 2;
float speed = 0.1;
void setup() {
size(600, 600);
background(255);
}
void draw() {
background(0);
noCursor(); //no mouse
float x1 = offset + cos(angle) * scalar;
float y1 = offset + sin(angle) * scalar;
angle += speed;
scalar += speed;///make lines' head spining around
for (int x=30; x<width; x += 100) {
for (int y=30; y <height; y += 100) {
strokeWeight(1);
stroke(200, 30, 144, 100);
line(x1, y1, x, y); //moving line
line(x1+x, y1+y, x, y);//movng line
line(x1+30, y1+30, x, y);//moving line
line(x1+50, y1+100, x, y);//moving
line(x1+100, y1+200, x, y);//line
}
}
if (mouseX<width/2) {
stroke(200, 30, 144, 100);
strokeWeight(10);
ellipse(mouseX, mouseY, random(d), random(d));//ellipse
ellipse(mouseY, mouseX, random(d), random(d));
} else {
stroke(200, 30, 144, 100);
strokeWeight(10);
rect(mouseX, mouseY, random(d), random(d));//shaking rect
rect(mouseY, mouseX, random(d), random(d));
}
//saveFrame("output/gol_####.png");
}
Comments
Post a Comment