Created
July 24, 2020 14:00
-
-
Save afnizarnur/b1ebce947c8bd2f362ec2836387b5b02 to your computer and use it in GitHub Desktop.
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
float bg = 20; | |
float s = 255; | |
float xoff = 0; | |
float yoff = 1000; | |
float u(float n) { | |
return width/100 * n; | |
} | |
void setup() { | |
size(1000,1000); | |
background(bg); | |
strokeWeight(1); | |
stroke(s); | |
smooth(); | |
} | |
void draw() { | |
background(bg); | |
for(float y = height*0.1; y < height*0.9; y += u(1.5)) { | |
pushMatrix(); | |
translate(0, y); | |
noFill(); | |
beginShape(); | |
for(float x = width*0.1; x < width*0.9; x++) { | |
float ypos = map(noise(x/100 + xoff, y/100 + yoff), 0, 1, -100, 100); | |
float magnitude = x < width*0.5 ? map(x, width*0.1, width*0.5, 0, 1) : map(x, width*0.5, width*1, 1, 0) ; | |
ypos *= magnitude * 2 - 1; | |
if(ypos > 0) ypos = 0; | |
vertex(x, ypos); | |
} | |
endShape(); | |
popMatrix(); | |
} | |
xoff += 0.02; | |
yoff += -0.02; | |
} | |
void mousePressed() { | |
String name = "yoel" + ".png"; | |
saveFrame(name); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment