Sunday, January 24, 2010

Killing time

//******************
// Original Rose graphics
// by Mar Canet
//******************

float longitude = 40.0f;
float theta = radians(30);
float theta2 = radians(30);
float px,py;
int k = 11;

void setup()
{
  size(800,600);
  background(255);
  frameRate(2);
   ellipseMode(CENTER);
    strokeWeight(2);

  
}

  
  void draw()
{
translate(random(width),random(height));
   k = ((int)random(15)) +5;
   
 
 float randomR = random(255);
 float randomG = random(255);
 float randomB = random(255);
 int forLimit = floor(TWO_PI/0.01);
 
   for ( int i = 1; i < forLimit; i ++ ) {
    
     theta2 += 0.06;
     if( theta2 >=TWO_PI ) theta2 = 0;
     theta +=0.01;
     if( theta >=TWO_PI ) theta = 0;
   
     float r = longitude * cos( k*theta );
     float y = r * sin(theta2);
     float x = r * cos(theta2+y);
   
     randomR += random(-2,2);
  randomG += random(-2,2);
   randomB += random(-2,2);
  
 stroke(randomR,randomG,randomB,60);
    line(px,py,x,y);
     px = x;
     py = y;
    }
    }

infoinfo

submitted by: DARYL_Gamma
views: 

Original Rose graphics by Mar Canet. This one does the fills by drawing a line to the center pf the flower instead of drawing a contour. Also, the color is varied a bit.

treeThis sketch has a parent
Tags:

commentscomment

loading loading...

 

Add a comment: