Skip to content

Instantly share code, notes, and snippets.

@m0wh
Created March 8, 2018 10:03
Show Gist options
  • Save m0wh/e56e485aac56d3be51bdcb9b3473cc79 to your computer and use it in GitHub Desktop.
Save m0wh/e56e485aac56d3be51bdcb9b3473cc79 to your computer and use it in GitHub Desktop.
Processing experimentation
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;
}
@m0wh
Copy link
Author

m0wh commented Feb 12, 2019

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment