-
-
Save AfzalivE/e26d4b10efdd7239031e to your computer and use it in GitHub Desktop.
Inspiration for openGL stuff
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
URL: http://beesandbombs.tumblr.com/page/6 | |
void setup(){ | |
size(500,500,P3D); | |
smooth(8); | |
} | |
float f(int i, int j, float q){ | |
return(q*(noise(.2*(i+400-.05*frameCount),.2*(j+90))-.5)); | |
} | |
float s; | |
void draw(){ | |
s = 5*(1-cos(TWO_PI*frameCount/40)); | |
background(0); | |
stroke(255); | |
strokeWeight(0.04); | |
pushMatrix(); | |
translate(width/2+5,height*.5,-100); | |
rotateX(PI*.4); | |
scale(25); | |
for(int i=-19; i<21; i++){ | |
for(int j=-19; j<21; j++){ | |
if(i!=20) | |
line(i,j,f(i,j,s),i+1,j,f(i+1,j,s)); | |
if(j!=20) | |
line(i,j,f(i,j,s),i,j+1,f(i,j+1,s)); | |
} | |
} | |
popMatrix(); | |
saveFrame("f##.png"); | |
if(frameCount==40) | |
exit(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment