2010年12月26日日曜日

Practice (Vertex)


size (600,600);
background(100);
smooth();
noStroke();
fill(240,53,34);
beginShape();
vertex(20,20);
vertex(350,220);
vertex(540,420);
vertex(130,520);
vertex(220,450);
vertex(60,590);
endShape(CLOSE);
stroke(1);
strokeWeight(40);

ellipse(300,300,400,400);





Learning fill command



float R,G,B,A;
int Rcounter=0;
int Gcounter=0;
int Bcounter=0;
int Acounter=0;


void setup(){
size(600,600);
background(0);
R=0;
G=0;
B=10;
A=0;
}

void draw(){
if(Acounter==0){
A++;
if(A==255){
Acounter=1;
}
}
else if (Acounter==1){
A--;
if(A==0){
Acounter=0;
ArandomSection();
}
}

if(Rcounter==0){
R++;
if(R==255){
Rcounter=1;
}
}
else if (Rcounter==1){
R--;
if(R==0){
Rcounter=0;
}
}

if(Gcounter==0){
G++;
if(G==255){
Gcounter=1;
}
}
else if (Gcounter==1){
G--;
if(G==0){
Gcounter=0;
}
}

if(Bcounter==0){
B++;
if(B==255){
Acounter=1;
ArandomSection();
}
}
else if (Bcounter==1){
B--;
if(B==0){
Bcounter=0;
}
}


fill(R,G,B,A);
ellipse(mouseX,mouseY,80,80);
}


void ArandomSection(){
R = random(0,255);
G = random(0,255);
B = random(0,255);
}





2010年12月25日土曜日

Hello World



void setup(){
size(600,600);
}
void draw(){
for(float i=0; i<100; i+=0.2){
for(float e=10; e<100; e++){

ellipse(i*e,i*i,i,i);

}
}
}