Skip to content

Instantly share code, notes, and snippets.

@volfegan
Created December 13, 2021 21:48
Show Gist options
  • Save volfegan/5eb2e73c82b4bba124aeb4ab5b69e9bf to your computer and use it in GitHub Desktop.
Save volfegan/5eb2e73c82b4bba124aeb4ab5b69e9bf to your computer and use it in GitHub Desktop.
Algae underwater floating shape
//https://www.youtube.com/watch?v=oeJd53nj7lk
float t, x, y, w;
void setup() {
size(1080, 480);
stroke(255);
fill(255);
}
void draw() {
clear();
t+=.1;
for (float i=50; i>0; i--) {
x=width/2;
y=height;
w=3;
for (float j=height; j>0; j--) {
x=x+sin(w);
y=y+sin(w+8);
w=w+sin(sin(sin(i)*5+j/35+t/26)*3+j/37+t/20)/30;
set((int)x, (int)y, color(255));
//x=x+2*sin(w);
//y=y+2*sin(w+8);
//float l = i+j/5+t;
//circle(x,y,10*sin(l));
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment