Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- float y;
- float a, f;
- void setup() {
- size(1080, 720);
- background(34);
- a = random(2,10);
- f = random(0.05);
- }
- void draw() {
- //background(34);
- stroke(238, 10);
- float amplitude = a; //10;
- float frequency = f; //0.01;
- beginShape();
- noFill();
- for (int x=0; x<width; x+=2) {
- y = sin(x*frequency);
- float t = 0.000001*(-millis()*130);
- t = -frameCount/500.0;
- y += sin(x*frequency*2.1 + t)*4.5;
- y += sin(x*frequency*1.72 + t*1.121)*4.0;
- y += sin(x*frequency*2.221 + t*0.437)*5.0;
- y += sin(x*frequency*3.1122+ t*4.269)*2.5;
- y *= amplitude;
- vertex(x, height/2+y);
- }
- endShape();
- }
- void keyPressed() {
- save(random(9999)+".png");
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement