Generative Art #181
Code
void setup() {
size(900, 900);
pixelDensity(2);
noLoop();
}
void draw() {
int c = int(random(4,11));
float z = random(986);
float zStep = 0.00001;
color col = getCol();
background(getCol());
for (int i=0; i<c; i++) {
float x = random(1)*width;
float y = random(1)*height;
float maxw = random(5, 25);
float l = random(100, 200)*maxw;
for (int j=0; j<l; j++) {
float ans = 0.0003;
float wns = 0.004;
float w = noise(j*wns, i*wns)*maxw;
float angle = noise(x*ans, y*ans, z)*50;
noStroke();
fill(col);
circle(x, y, w);
y += sin(angle);
x += cos(angle);
z += zStep;
}
}
for(int i=0; i<300; i++){
fill(col);
circle(random(1)*width, random(1)*height, myRandom()*100);
}
noiseSeed(int(random(1000)));
//saveFrame("output/####.png");
//if(frameCount > 200)exit();
}
float myRandom(){
return random(random(random(random(random(random(1))))));
}
void mousePressed() {
redraw();
}
void keyPressed() {
if (key == 's')saveFrame("####.png");
}
int[] colors = {#fe4a49,#2ab7ca,#fed766,#4f4ff7, #ffffff, #FF9BDA};
int getCol() {
return colors[(int)random(colors.length)];
}
スプラッシュペインティングを表現。
Happy coding!
応援してくださる方!いつでもサポート受け付けてます!