星期三, 四月 04, 2012
Stained glass No Stroke
//Made by Reuben Williamson.
//Follow @SubtleMonster!
float count=0; //count is what makes the tings rotate.
void setup(){
smooth();
//Makes the umberellas smooth
background(0,0,0);
size(800,800);
frameRate(20);
//slows the frame rate for more inpact.
}
//All this next bit is about the actual umberellas.
void draw() {
noStroke();
int posx = int(random(0,width));
int posy = int(random(0,height));
float radius = random(10,30);
//these are the positions which are used
//later to draw the umberellas
fill(random(1,500),random(1,500),random(1,500),30);
strokeWeight(random(0,2));
//here is the code for the circles
//around the star shapes.
pushMatrix();
translate(width/4,height/4);
rotate(PI*count);
ellipse(posx,30,radius*4,radius*4);
ellipse(posx,50,radius*3,radius*3);
ellipse(posx,70,radius*2.5,radius*2.5);
//this is the code for the the stars
//in the center of the circles.
for(float i = 0.0; i < 2.0*PI; i+=0.5-radius/200){
line(posx,posy,posx+sin(i)*radius,posy+cos(i)*radius);
}
popMatrix();
if(count<2.1) {
count=count+0.005;
//this code is all about the rotation
}
else{ count=0;}
}
//the end of the code.
//Follow @SubtleMonster!
float count=0; //count is what makes the tings rotate.
void setup(){
smooth();
//Makes the umberellas smooth
background(0,0,0);
size(800,800);
frameRate(20);
//slows the frame rate for more inpact.
}
//All this next bit is about the actual umberellas.
void draw() {
noStroke();
int posx = int(random(0,width));
int posy = int(random(0,height));
float radius = random(10,30);
//these are the positions which are used
//later to draw the umberellas
fill(random(1,500),random(1,500),random(1,500),30);
strokeWeight(random(0,2));
//here is the code for the circles
//around the star shapes.
pushMatrix();
translate(width/4,height/4);
rotate(PI*count);
ellipse(posx,30,radius*4,radius*4);
ellipse(posx,50,radius*3,radius*3);
ellipse(posx,70,radius*2.5,radius*2.5);
//this is the code for the the stars
//in the center of the circles.
for(float i = 0.0; i < 2.0*PI; i+=0.5-radius/200){
line(posx,posy,posx+sin(i)*radius,posy+cos(i)*radius);
}
popMatrix();
if(count<2.1) {
count=count+0.005;
//this code is all about the rotation
}
else{ count=0;}
}
//the end of the code.
comments

Add a comment: