Sunday, May 31, 2009

viruses/Bubbles02

int numberOfCircles = 62;

int[] xPositions = new int[numberOfCircles];
int[] yPositions = new int[numberOfCircles];

int circleSize = 20;

int canvasSizex = 400;
int canvasSizey = 400;


void setup() 
{
  size(canvasSizex, canvasSizey);
  background(225,225,225);
  
  smooth();
  
/*
  strokeWeight(4);  
  
  ellipse(50,50,circleSize,circleSize);

  ellipse(70,70,circleSize,circleSize);

noStroke();

  ellipse(70,70,circleSize,circleSize);

  ellipse(50,50,circleSize,circleSize);
*/

for(int i=0; i < numberOfCircles; i++){
  xPositions[i] = int(random(0,canvasSizex));
  yPositions[i] = int(random(0,canvasSizey));
}


}


void draw() {

  fill(225,225,225);
  rect(0,0,canvasSizex,canvasSizey);

  fill(25,123,55);

  for(int i=0; i < numberOfCircles; i++){
    xPositions[i] += int(random(-5,5));
    yPositions[i] += int(random(-5,5));
  }

  stroke(4);  
  strokeWeight(4);  
  for(int i=0; i < numberOfCircles; i++){
    ellipse(xPositions[i],yPositions[i],circleSize,circleSize);
  }

  noStroke();  
  for(int i=0; i < numberOfCircles; i++){
    ellipse(xPositions[i],yPositions[i],circleSize,circleSize);
  }

}

infoinfo

submitted by: sophie.mcdonald

another version, this time without the trail. Bethan recons this looks like how viruses behave! * Bubbles by Sophie & Davide, inspired by David Hirmes blobs * http://www.friendsofed.com/fmc/FMCv2/FMC.html */

treeThis sketch has a parent
Tags: bubbles, animation

commentscomment

loading loading...

 

sign in to Add a comment: