Skip to content

Instantly share code, notes, and snippets.

@bhattisatish
Last active August 29, 2015 13:58
Show Gist options
  • Save bhattisatish/9947320 to your computer and use it in GitHub Desktop.
Save bhattisatish/9947320 to your computer and use it in GitHub Desktop.
Processing file for generating ...
/*Original Source: http://www.reddit.com/r/processing/comments/221krp/thoughts_on_how_to_make_this/cginzbn */
float a;
void setup() {
size(800, 800);
rectMode(CENTER);
}
void draw() {
translate(width/2, height*0.4);
noStroke();
fill(245, 50);
rect(0, 0, width, height);
float wav = map(sin(a), -1, 1, -4.0, 4.0);
noFill();
stroke(50, 200);
strokeWeight(1);
for (int i = 1; i < 118; i++) {
triangle(
sin(radians(i*wav))*(410-i*wav), cos(radians(i*wav))*(410-i*wav),
sin(radians(i*wav+240))*(410-i*wav), cos(radians(i*wav+240))*(410-i*wav),
sin(radians(i*wav+120))*(410-i*wav), cos(radians(i*wav+120))*(410-i*wav)
);
}
a += 0.05;
}
void alternate() {
size(800, 800);
stroke(0);
smooth(4);
fill(255, 255, 255, 0);
background(255);
translate(width/2, height/2 - 100);
int iterations = 100;
for (int i = 0; i < iterations; i ++) {
pushMatrix();
rotate(- radians( 1 * i ));
scale(1 - ( float(i) / iterations));
triangle(-400, -230.94,
400, -230.94,
0, 461.88);
popMatrix();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment