Skip to content

Instantly share code, notes, and snippets.

@jkwok91
Last active January 6, 2016 00:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jkwok91/b68d63cd4dcba680880e to your computer and use it in GitHub Desktop.
Save jkwok91/b68d63cd4dcba680880e to your computer and use it in GitHub Desktop.
trippy af. this is from nature of code
float xr = 0;
float yr = 0;
void setup() {
size(400,400);
}
void draw() {
loadPixels();
float xoff = xr;
for (int x = 0; x < width; x++) {
float yoff = yr;
for (int y = 0; y < height; y++) {
float watR = map(noise(xoff),0,1,0,255);
float watG = map(noise(yoff),0,1,0,255);
float watB = map(noise(xoff,yoff),0,1,0,255);
pixels[x+y*width] = color(watR,watG,watB);
yoff+=0.01;
}
xoff+=0.01;
}
updatePixels();
xr+=(Math.pow(-1,int(random(2))))*noise(xr);
yr+=(Math.pow(-1,int(random(2))))*noise(yr);
}
@jkwok91
Copy link
Author

jkwok91 commented Jan 5, 2016

screen shot 2016-01-05 at 12 02 23 am
screen shot 2016-01-05 at 12 02 51 am

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