Wednesday, October 13, 2010

Animated pattern Exercise

void setup(){
  size(800,800);
  smooth();
  background(0);
  for(int x = 10; x <= width/2; x *= 1.25){
    for(int y = 10; y <= height/2; y *= 1.25){
      stroke(255);
      fill(255,0,0,5);
      ellipseMode(RADIUS);
      ellipse( width/2, height/2, x, y);
      noStroke();
      noFill();
    }
  }


}
void draw(){
 
 
  for(int a = 0;a <=width; a +=50){
    for(int b =0; b<=height; b+=50){
     stroke(mouseX,mouseY,mouseX-mouseY,5);

  line(mouseX,mouseY,a,b);
    }
  }
}

I fixed the problem I was having with the infinite draw function and managed to add some animation to it.

No comments:

Post a Comment