Created
March 8, 2018 10:03
-
-
Save m0wh/e56e485aac56d3be51bdcb9b3473cc79 to your computer and use it in GitHub Desktop.
Processing experimentation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int ITERATIONS = 2000; | |
void setup() { | |
size(800,800); | |
//noLoop(); | |
} | |
void draw() { | |
background(255); | |
translate(0, height/2); | |
noStroke(); | |
fill(0); | |
beginShape(); | |
for(int i = 0; i <= ITERATIONS; i++) { | |
float n = random(width); | |
int x = round(random(2)); | |
switch(x) { | |
case 0: | |
//ellipse(n, f(n),10,10); | |
vertex(n, f(n)); | |
case 1: | |
//ellipse(n, -f(n),10,10); | |
vertex(n, -f(n)); | |
} | |
} | |
endShape(CLOSE); | |
} | |
float f(float n) { | |
return sin(n/20)*50-80; | |
} |
Author
m0wh
commented
Feb 12, 2019
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment