Friday, September 11, 2009

squaresnake V2

int r = 155;
int frame = 0;

void setup()
{
  size(800,600);
  noStroke();
}
  
void draw() 
{
  background(0,0,0);
  translate(-20,100);
  frame++;

  for (float i=0; i < 30; i += max(0.5,mouseY/200))
  {  
    fill(r - i*width/2,125 + i*15,125-i*9,90);
    translate(width/2,height/2);
    rotate((i-25)*(width/2 - mouseX+10*noise((frame/10)%10))/width*PI/180);
    translate(-width/2,-height/2);
    rect(width/2 + i,height/2 -i*7,
         75 - i * 2, 75 -i * 2);
  }
}

info info

submitted by: DARYL_Gamma
views: 1644
Variations on the squaresnake. The nice volumetric effect is given by the pile of semitransparent squares. The curling has been achieved more by trial and error than by design...

treeThis sketch has a parent
Tags:

comments comment

loading loading...

 

Add a comment: