int locationtree_x = 150;
int locationtree_y = 0;
float locationleaf_x = 150;
float update = 0.1;
void setup()
{
size(323, 200);
stroke(255);
frameRate(30);
}
void draw() {
background(255);
draw_tree(locationtree_x, locationtree_y, locationleaf_x);
draw_tree(locationtree_x-310, locationtree_y, locationleaf_x-310);
draw_tree(locationtree_x-210, locationtree_y, locationleaf_x-210);
draw_tree(locationtree_x-100, locationtree_y, locationleaf_x-100);
draw_tree(locationtree_x-160, locationtree_y-10, locationleaf_x-160);
draw_tree(locationtree_x-50, locationtree_y-10, locationleaf_x-50);
draw_tree(locationtree_x-260, locationtree_y-10, locationleaf_x-260);
locationleaf_x = locationleaf_x - update;
if (locationleaf_x < 148 || locationleaf_x > 150) {
update = update*-1 ;
}
}
void draw_tree(int locationtree_x, int locationtree_y, float locationleaf_x)
{
noStroke();
fill(204, 102, 0);
rect(155+locationtree_x, 120+locationtree_y, 18, 80);
triangle(152+locationtree_x, 215+locationtree_y, 164+locationtree_x, 100+locationtree_y, 176+locationtree_x, 215+locationtree_y);
triangle(152+locationtree_x, 151+locationtree_y, 164+locationtree_x, 200+locationtree_y, 176+locationtree_x, 151+locationtree_y);
leaf(locationleaf_x, locationtree_y);
}
void leaf(float locationleaf_x, int locationleaf_y) {
fill(0, 95, 0);
ellipse(135+locationleaf_x, 65+locationleaf_y, 30, 30);
ellipse(165+locationleaf_x, 132+locationleaf_y, 30, 30);
ellipse(195+locationleaf_x, 65+locationleaf_y, 30, 30);
ellipse(120+locationleaf_x, 120+locationleaf_y, 30, 30);
ellipse(150+locationleaf_x, 130+locationleaf_y, 30, 30);
ellipse(135+locationleaf_x, 132+locationleaf_y, 30, 30);
ellipse(145+locationleaf_x, 138+locationleaf_y, 30, 30);
ellipse(185+locationleaf_x, 138+locationleaf_y, 30, 30);
ellipse(155+locationleaf_x, 136+locationleaf_y, 30, 30);
ellipse(175+locationleaf_x, 136+locationleaf_y, 30, 30);
fill(0, 135, 0);
ellipse(210+locationleaf_x, 120+locationleaf_y, 30, 30);
ellipse(150+locationleaf_x, 100+locationleaf_y, 30, 30);
ellipse(220+locationleaf_x, 105+locationleaf_y, 30, 30);
ellipse(150+locationleaf_x, 55+locationleaf_y, 30, 30);
fill(0, 125, 0);
ellipse(180+locationleaf_x, 100+locationleaf_y, 30, 30);
ellipse(165+locationleaf_x, 110+locationleaf_y, 30, 30);
ellipse(135+locationleaf_x, 110+locationleaf_y, 30, 30);
ellipse(180+locationleaf_x, 55+locationleaf_y, 30, 30);
ellipse(115+locationleaf_x, 105+locationleaf_y, 30, 30);
ellipse(195+locationleaf_x, 132+locationleaf_y, 30, 30);
fill(0, 145, 0);
ellipse(195+locationleaf_x, 110+locationleaf_y, 30, 30);
ellipse(165+locationleaf_x, 85+locationleaf_y, 30, 30);
ellipse(135+locationleaf_x, 75+locationleaf_y, 30, 30);
ellipse(165+locationleaf_x, 50+locationleaf_y, 30, 30);
fill(0, 155, 0);
ellipse(195+locationleaf_x, 75+locationleaf_y, 30, 30);
ellipse(120+locationleaf_x, 85+locationleaf_y, 30, 30);
ellipse(210+locationleaf_x, 85+locationleaf_y, 30, 30);
ellipse(155+locationleaf_x, 70+locationleaf_y, 30, 30);
ellipse(180+locationleaf_x, 130+locationleaf_y, 30, 30);
fill(0, 165, 0);
ellipse(175+locationleaf_x, 70+locationleaf_y, 30, 30);
ellipse(165+locationleaf_x, 65+locationleaf_y, 30, 30);
ellipse(135+locationleaf_x, 85+locationleaf_y, 30, 30);
ellipse(195+locationleaf_x, 85+locationleaf_y, 30, 30);
}
วันอาทิตย์ที่ 31 สิงหาคม พ.ศ. 2557
L.? tree
วันพุธที่ 27 สิงหาคม พ.ศ. 2557
spoon and fork
void setup() {
size(300, 200);
background(60,120,60);
int move_x = 10;
int move_y = 20;
stroke(196);
fill(196);
rect(76+move_x, 70+move_y, 6, 80,7);
ellipse(80+move_x, 70+move_y, 30, 40);
rect(155+move_x, 50+move_y, 2, 34,11);
rect(150+move_x, 50+move_y, 2, 34,11);
rect(165+move_x, 50+move_y, 2, 34,11);
rect(160+move_x, 50+move_y, 2, 34,11);
rect(156+move_x, 80+move_y, 6, 70,11);
rect(150+move_x, 80+move_y, 17, 6,7);
}
L.1 Dream
void setup() {
size(400, 300);
background(20,100,200);
fill(200);
int move_x=20;
rect(100+move_x,200,200,200);
rect(100+move_x,200,100,100);
fill(102,25,0);
triangle(200+move_x, 200, 250+move_x, 130, 300+move_x, 200);
noStroke();
rect(151+move_x,130,99,70);
stroke(0);
triangle(100+move_x, 200, 150+move_x, 130, 200+move_x, 200);
fill(200,50,50);
rect(130+move_x,250,40,50);
line(150+move_x,250,150+move_x,300);
fill(0,150,255);
rect(250+move_x,250,20,30);
rect(230+move_x,250,20,30);
}
Dream
void setup() {
size(400, 300);
background(20,100,200);
fill(200);
rect(100,200,200,200);
rect(100,200,100,100);
fill(102,25,0);
triangle(200, 200, 250, 130, 300, 200);
noStroke();
rect(151,130,99,70);
stroke(0);
triangle(100, 200, 150, 130, 200, 200);
fill(200,50,50);
rect(130,250,40,50);
line(150,250,150,300);
fill(0,150,255);
rect(250,250,20,30);
rect(230,250,20,30);
}
L.1 Subject
void setup() {
size(400, 300);
background(0);
int sun_color_red=250,sun_color_green=200,sun_color_blue=0;
fill(sun_color_red, sun_color_green, sun_color_blue);//sun color
int move_sun_X=x,move_sun_Y=y;//move sun
int x=-10,y=0;
ellipse(-200+x, 150+y, 600, 600);//sun
int mercury_color_red=250,mercury_color_green=250,mercury_color_blue=0;
fill(mercury_color_red,mercury_color_green,mercury_color_blue);//mercury color
int move_mercury_X=10,move_mercury_Y=10;
ellipse(120+move_mercury_X, 150+move_mercury_Y, 10, 10);//mercury
int venus_color_red=179,venus_color_green=150,venus_color_blue=0;
fill(venus_color_red,venus_color_green,venus_color_blue);//venus color
int move_venus_X=10,move_venus_Y=10;
ellipse(175+move_venus_X, 150+move_venus_Y, 30, 30);//venus
int earth_color_red=0,earth_color_green=118,earth_color_blue=174;
fill(earth_color_red,earth_color_green,earth_color_blue);//earth color
int move_earth_X=10,move_earth_Y=10;
ellipse(240+move_earth_X, 150+move_earth_Y, 33, 33);//earth
int mars_color_red=94,mars_color_green=47,mars_color_blue=0;
fill(mars_color_red,mars_color_green,mars_color_blue);//mars color
int move_mars_X=10,move_mars_Y=10;
ellipse(300+move_mars_X, 150+move_mars_Y, 25, 25);//mars
int jupiter_color_red=255,jupiter_color_green=194,jupiter_color_blue=140;
fill(jupiter_color_red,jupiter_color_green,jupiter_color_blue);//jupiter color
int move_jupiter_X=10,move_jupiter_Y=10;
ellipse(390+move_jupiter_X, 150+move_jupiter_Y, 120, 120);//jupiter
}
วันอังคารที่ 26 สิงหาคม พ.ศ. 2557
Subject
void setup() {
size(400, 300);
background(0);
fill(250, 200, 0);//sun color
ellipse(-200, 150, 600, 600);//sun
fill(250, 250, 0);//mercury color
ellipse(120, 150, 10, 10);//mercury
fill(179, 116, 0);//venus color
ellipse(175, 150, 30, 30);//venus
fill(0, 118, 174);//earthcolor
ellipse(240, 150, 33, 33);//earth
fill(94, 47, 0);//mars color
ellipse(300, 150, 25, 25);//mars
fill(255, 194, 140);//jupiter color
ellipse(390, 150, 120, 120);//jupiter
}
Star
void setup() {
size(400, 300);
int background_color_red=10,
background_color_green=50,
background_color_blue=100;
background(background_color_red, background_color_green, background_color_blue);
int location_X=x, location_Y=y;
int x=50, y=50;
int color_red=200, color_green=200, color_blue=0;
strokeWeight(2);
stroke(color_red, color_green, color_blue);
fill(200, 200, 0);
beginShape();
vertex(47+x, 0+y);
vertex(61+x, 30+y);
vertex(94+x, 35+y);
vertex(70+x, 57+y);
vertex(76+x, 90+y);
vertex(47+x, 75+y);
vertex(18+x, 90+y);
vertex(24+x, 57+y);
vertex(0+x, 35+y);
vertex(33+x, 30+y);
endShape(CLOSE);
}
Football field
void setup()
{
size (430,300);
background (0);
stroke(255);
strokeWeight(4);
int filed_color_red=0;
int filed_color_green=150;
int filed_color_blue=20;
fill(filed_color_red, filed_color_green, filed_color_blue);//filed color
int filed_width=x, filed_length=y;
int x=5,y=5;
rect(13+x,14+y,400,270);//field
strokeWeight(4);//
line(215+x, 280+y, 215+x, 15+y);//half-way line
strokeWeight(3);
rect(13+x,75+y,70,150);//penalty area left
rect(343+x,75+y,70,150);//penalty area right
rect(13+x,107+y,30,90);//goal
rect(383+x,107+y,30,90);//goal
int center_radius=70;
ellipse(215+x,150+y,center_radius,center_radius);//centre circle
arc(342+x,152+y,50,50, PI/2,TWO_PI-PI/2);
arc(85+x,152+y,50,50, -PI/2,PI/2);
arc(16+x, 16+y, 20, 20, 0, PI/2);
arc(410+x, 16+y, 20, 20, PI/2, PI);
arc(410+x, 281+y, 20, 20, PI, TWO_PI-PI/2);
arc(16+x, 281+y, 20, 20, TWO_PI-PI/2, TWO_PI);
fill(255);
ellipse(62+x, 151+y, 5, 5);
ellipse(362+x, 151+y, 5, 5);
ellipse(215+x, 151+y, 5, 5);//centre spot
}
วันพุธที่ 20 สิงหาคม พ.ศ. 2557
L.1 tree
void setup() {
size(323, 200);
background(207, 231, 245);
int x=20;
int y=-15;
noStroke();
fill(204, 102, 0);
rect(155+x, 120, 18, 80)
triangle(152+x, 215+y, 164+x, 100+y, 176+x, 215+y)
triangle(152+x, 151+y, 164+x, 200+y, 176+x, 151+y)
fill(0, 95, 0);
ellipse(135+x, 65+y, 30, 30)
ellipse(165+x, 132+y, 30, 30)
ellipse(195+x, 65+y, 30, 30)
ellipse(120+x, 120+y, 30, 30)
ellipse(150+x, 130+y, 30, 30)
ellipse(135+x, 132+y, 30, 30)
ellipse(145+x, 138+y, 30, 30)
ellipse(185+x, 138+y, 30, 30)
ellipse(155+x, 136+y, 30, 30)
ellipse(175+x, 136+y, 30, 30)
fill(0, 135, 0);
ellipse(210+x, 120+y, 30, 30)
ellipse(150+x, 100+y, 30, 30)
ellipse(220+x, 105+y, 30, 30)
ellipse(150+x, 55+y, 30, 30)
fill(0, 125, 0);
ellipse(180+x, 100+y, 30, 30)
ellipse(165+x, 110+y, 30, 30)
ellipse(135+x, 110+y, 30, 30)
ellipse(180+x, 55+y, 30, 30)
ellipse(115+x, 105+y, 30, 30)
ellipse(195+x, 132+y, 30, 30)
fill(0, 145, 0);
ellipse(195+x, 110+y, 30, 30)
ellipse(165+x, 85+y, 30, 30)
ellipse(135+x, 75+y, 30, 30)
ellipse(165+x, 50+y, 30, 30)
fill(0, 155, 0);
ellipse(195+x, 75+y, 30, 30)
ellipse(120+x, 85+y, 30, 30)
ellipse(210+x, 85+y, 30, 30)
ellipse(155+x, 70+y, 30, 30)
ellipse(180+x, 130+y, 30, 30)
fill(0, 165, 0);
ellipse(175+x, 70+y, 30, 30)
ellipse(165+x, 65+y, 30, 30)
ellipse(135+x, 85+y, 30, 30)
ellipse(195+x, 85+y, 30, 30)
}
วันพุธที่ 13 สิงหาคม พ.ศ. 2557
Tree
void setup() {
size(323, 200);
background(207, 231, 245);
noStroke();
fill(204, 102, 0);
rect(155, 120, 18, 80);
triangle(152, 200, 164, 100, 176, 200);
triangle(152, 151, 164, 200, 176, 151);
fill(0, 95, 0);
ellipse(135, 65, 30, 30);
ellipse(165, 132, 30, 30);
ellipse(195, 65, 30, 30);
ellipse(120, 120, 30, 30);
ellipse(150, 130, 30, 30);
ellipse(135, 132, 30, 30);
ellipse(145, 138, 30, 30);
ellipse(185, 138, 30, 30);
ellipse(155, 136, 30, 30);
ellipse(175, 136, 30, 30);
fill(0, 135, 0);
ellipse(210, 120, 30, 30);
ellipse(150, 100, 30, 30);
ellipse(220, 105, 30, 30);
ellipse(150, 55, 30, 30);
fill(0, 125, 0);
ellipse(180, 100, 30, 30);
ellipse(165, 110, 30, 30);
ellipse(135, 110, 30, 30);
ellipse(180, 55, 30, 30);
ellipse(115, 105, 30, 30);
ellipse(195, 132, 30, 30);
fill(0, 145, 0);
ellipse(195, 110, 30, 30);
ellipse(165, 85, 30, 30);
ellipse(135, 75, 30, 30);
ellipse(165, 50, 30, 30);
fill(0, 155, 0);
ellipse(195, 75, 30, 30);
ellipse(120, 85, 30, 30);
ellipse(210, 85, 30, 30);
ellipse(155, 70, 30, 30);
ellipse(180, 130, 30, 30);
fill(0, 165, 0);
ellipse(175, 70, 30, 30);
ellipse(165, 65, 30, 30);
ellipse(135, 85, 30, 30);
ellipse(195, 85, 30, 30);
ellipse(115, 105, 30, 30);
ellipse(195, 132, 30, 30);
fill(0, 145, 0);
ellipse(195, 110, 30, 30);
ellipse(165, 85, 30, 30);
ellipse(135, 75, 30, 30);
ellipse(165, 50, 30, 30);
fill(0, 155, 0);
ellipse(195, 75, 30, 30);
ellipse(120, 85, 30, 30);
ellipse(210, 85, 30, 30);
ellipse(155, 70, 30, 30);
ellipse(180, 130, 30, 30);
fill(0, 165, 0);
ellipse(175, 70, 30, 30);
ellipse(165, 65, 30, 30);
ellipse(135, 85, 30, 30);
ellipse(195, 85, 30, 30);
}
สมัครสมาชิก:
บทความ (Atom)