Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@AfzalivE
Forked from anonymous/gist:11010752
Created May 23, 2014 04:51
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 AfzalivE/e26d4b10efdd7239031e to your computer and use it in GitHub Desktop.
Save AfzalivE/e26d4b10efdd7239031e to your computer and use it in GitHub Desktop.
Inspiration for openGL stuff
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