-
-
Save jkwok91/b68d63cd4dcba680880e to your computer and use it in GitHub Desktop.
trippy af. this is from nature of code
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 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); | |
} |
Author
jkwok91
commented
Jan 5, 2016
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment