PÉS, X E BOLAS – EXERCÍCIO CÓDIGO

Para a composição estática, fiz dois exercícios.

No primeiro desenhei uns pés com uma tatuagem de um sol e de uma lua e coloquei uma imagem colorida como fundo. Para desenhar a figura utilizei, maioritariamente, a função da Curva de Bezier. Ao lado coloquei a imagem utilizada como fundo.

Sem título         image

<pre>

size(425, 585);

PImage img;
img = loadImage(“image.jpg”);
image(img, 0, 0);

noFill();
strokeWeight(2);
bezier(38, 321, 28, 328, 0, 367, 0, 367);

bezier(73, 279, 66, 291, 52, 308, 38, 321);

bezier(99, 239, 95, 252, 77, 273, 73, 279);

bezier(111, 211, 106, 222, 106, 227, 99, 239);

bezier(127, 175, 121, 187, 114, 202, 111, 211);

bezier(142, 141, 139, 150, 129, 169, 127, 175);

bezier(150, 99, 152, 110, 146, 128, 142, 141);

bezier(149, 79, 148, 86, 147, 91, 150, 99);

bezier(145, 64, 147, 70, 150, 73, 149, 79);

line(145, 64, 135, 51);

bezier(141, 40, 136, 43, 134, 46, 135, 51);

bezier(151, 34, 145, 35, 143, 37, 141, 40);

bezier(183, 64, 178, 51, 159, 35, 151, 34);

bezier(187, 80, 183, 72, 182, 72, 183, 64);

bezier(196, 91, 191, 86, 190, 84, 187, 80);

bezier(207, 104, 203, 98, 200, 95, 196, 91);

bezier(212, 117, 210, 109, 209, 108, 207, 104);

bezier(212, 122, 212, 119, 212, 119, 212, 117);

bezier(202, 148, 203, 139, 207, 129, 212, 122);

bezier(202, 160, 201, 155, 201, 152, 202, 148);

bezier(202, 182, 203, 177, 203, 167, 202, 160);

bezier(199, 192, 200, 188, 201, 187, 202, 182);

bezier(191, 239, 190, 228, 193, 200, 199, 192);

bezier(198, 273, 196, 265, 192, 252, 191, 239);

bezier(203, 290, 200, 282, 199, 283, 198, 273);

bezier(216, 327, 212, 319, 206, 300, 203, 290);

bezier(222, 348, 221, 340, 219, 333, 216, 327);

bezier(223, 357, 223, 350, 224, 355, 222, 348);

line(223, 357, 223, 374);

bezier(219, 391, 221, 385, 222, 383, 223, 374);

bezier(207, 413, 211, 407, 216, 399, 219, 391);

line(207, 413, 200, 420);

bezier(179, 431, 187, 429, 195, 425, 200, 420);

bezier(144, 437, 153, 433, 169, 431, 179, 431);

bezier(113, 456, 120, 450, 135, 441, 144, 437);

bezier(57, 536, 64, 522, 105, 463, 113, 456);

bezier(28, 585, 34, 578, 52, 546, 57, 536);

bezier(224, 115, 219, 116, 215, 119, 212, 122);

bezier(242, 123, 239, 119, 229, 115, 224, 115);

bezier(237, 141, 239, 135, 241, 127, 242, 123);

bezier(236, 147, 237, 144, 237, 143, 237, 141);

bezier(239, 153, 239, 151, 238, 150, 236, 147);

line(239, 153, 240, 162);

bezier(244, 175, 243, 169, 242, 166, 240, 162);

bezier(244, 187, 244, 181, 245, 179, 244, 175);

bezier(250, 207, 249, 202, 246, 194, 244, 187);

bezier(265, 236, 261, 229, 253, 216, 250, 207);

line(265, 236, 269, 242);

bezier(283, 265, 279, 259, 274, 248, 269, 242);

bezier(337, 353, 327, 339, 293, 279, 283, 265);

bezier(388, 407, 382, 399, 349, 366, 337, 353);

bezier(425, 438, 417, 431, 399, 415, 388, 407);

bezier(188, 463, 188, 454, 195, 431, 200, 420);

bezier(190, 488, 188, 481, 187, 471, 188, 463);

bezier(208, 518, 200, 511, 193, 499, 190, 488);

bezier(234, 529, 224, 527, 214, 522, 208, 518);

bezier(248, 532, 248, 531, 243, 533, 234, 529);

bezier(298, 544, 287, 539, 270, 534, 248, 532);

bezier(356, 585, 346, 574, 319, 555, 298, 544);

bezier(150, 52, 147, 55, 146, 58, 144, 62);

bezier(141, 40, 145, 44, 148, 46, 150, 52);

bezier(228, 134, 233, 136, 235, 138, 237, 142);

bezier(235, 118, 230, 123, 229, 127, 228, 134);

strokeWeight(2.5);
bezier(198, 195, 210, 198, 211, 199, 215, 207);

bezier(215, 207, 220, 216, 220, 224, 214, 233);

bezier(214, 233, 209, 242, 202, 246, 193, 247);

bezier(219, 165, 222, 173, 208, 178, 206, 185);

bezier(226, 188, 220, 189, 216, 192, 214, 198);

bezier(236, 184, 235, 189, 232, 190, 226, 188);

bezier(232, 204, 226, 203, 225, 203, 220, 208);

bezier(244, 207, 240, 209, 236, 208, 232, 204);

bezier(224, 220, 228, 218, 233, 219, 237, 224);

bezier(237, 224, 240, 230, 242, 230, 246, 227);

bezier(219, 232, 226, 233, 230, 236, 229, 242);

bezier(229, 242, 230, 248, 234, 251, 240, 252);

bezier(211, 246, 216, 248, 218, 252, 216, 257);

bezier(216, 257, 217, 263, 218, 264, 225, 266);

bezier(199, 255, 204, 257, 206, 261, 205, 266);

bezier(205, 266, 204, 274, 207, 278, 213, 280);

bezier(197, 196, 188, 199, 181, 206, 178, 216);

bezier(178, 216, 176, 224, 178, 230, 179, 237);

bezier(179, 237, 182, 243, 185, 246, 192, 249);

noStroke();
fill(0, 0, 0);
beginShape();
vertex(177, 191);
vertex(180, 190);
vertex(180, 186);
vertex(182, 189);
vertex(186, 189);
vertex(184, 192);
vertex(185, 196);
vertex(182, 194);
vertex(178, 196);
vertex(179, 193);
vertex(177, 191);
endShape();

beginShape();
vertex(162, 195);
vertex(164, 194);
vertex(165, 190);
vertex(166, 193);
vertex(170, 192);
vertex(168, 195);
vertex(171, 198);
vertex(167, 198);
vertex(165, 200);
vertex(165, 196);
vertex(162, 195);
endShape();

beginShape();
vertex(161, 221);
vertex(163, 220);
vertex(163, 216);
vertex(166, 219);
vertex(168, 219);
vertex(167, 222);
vertex(169, 224);
vertex(166, 224);
vertex(163, 226);
vertex(163, 223);
vertex(161, 221);
endShape();

beginShape();
vertex(167, 249);
vertex(170, 248);
vertex(171, 244);
vertex(173, 247);
vertex(176, 247);
vertex(174, 250);
vertex(176, 254);
vertex(172, 253);
vertex(170, 255);
vertex(170, 252);
vertex(167, 249);
endShape();

</pre>

 

Na segunda composição estática criei um padrão com triângulos e formas poligonais, com variadas cores e por cima desenhei um X.

Semqwrwtulo

<pre>

size (300, 300);

colorMode(RGB);

stroke(252, 250, 252);

fill(255, 191, 249);
beginShape();
vertex (0, 0);
vertex (30, 0);
vertex (0, 5);
vertex(0, 0);
endShape();

fill(94, 156, 240);
beginShape();
vertex (0, 5);
vertex (6, 5);
vertex (0, 26);
vertex (0, 5);
endShape();

fill(198, 171, 209);
beginShape();
vertex (6, 5);
vertex (30, 0);
vertex (21, 27);
vertex(6, 5);
endShape();

fill(124, 237, 204);
beginShape();
vertex (6, 5);
vertex (21, 27);
vertex (0, 26);
vertex (6, 5);
endShape();

fill(202, 255, 167);
beginShape();
vertex (0, 26);
vertex (21, 27);
vertex (10, 63);
vertex(0, 26);
endShape();

fill(245, 209, 111);
beginShape();
vertex (0, 26);
vertex (10, 63);
vertex (0, 82);
vertex(0, 26);
endShape();

fill(255, 255, 167);
beginShape();
vertex (0, 82);
vertex (10, 63);
vertex (45, 85);
vertex(0, 82);
endShape();

fill(71, 152, 128);
beginShape();
vertex (0, 82);
vertex (45, 85);
vertex (48, 128);
vertex(0, 82);
endShape();

fill(245, 89, 18);
beginShape();
vertex (0, 82);
vertex (48, 128);
vertex (10, 140);
vertex(0, 82);
endShape();

fill(198, 171, 209);
beginShape();
vertex (0, 82);
vertex (13, 154);
vertex (0, 163);
vertex(0, 82);
endShape();

fill(94, 156, 240);
beginShape();
vertex (10, 140);
vertex (48, 128);
vertex (13, 154);
vertex(10, 140);
endShape();

fill(202, 255, 167);
beginShape();
vertex (0, 163);
vertex (48, 128);
vertex (54, 155);
vertex(0, 163);
endShape();

fill(252, 189, 140);
beginShape();
vertex (0, 163);
vertex (54, 155);
vertex (16, 180);
vertex(0, 163);
endShape();

fill(93, 242, 241);
beginShape();
vertex (0, 163);
vertex (16, 180);
vertex (0, 200);
vertex(0, 163);
endShape();

fill(255, 191, 249);
beginShape();
vertex (0, 200);
vertex (16, 180);
vertex (36, 234);
vertex(0, 200);
endShape();

fill(183, 118, 177);
beginShape();
vertex (16, 180);
vertex (54, 155);
vertex (26, 207);
vertex (16, 180);
endShape();

fill(94, 156, 240);
beginShape();
vertex (26, 207);
vertex (54, 155);
vertex (69, 190);
vertex (26, 207);
endShape();

fill(71, 152, 128);
beginShape();
vertex (26, 207);
vertex (69, 190);
vertex (67, 223);
vertex(26, 207);
endShape();

fill(198, 171, 209);
beginShape();
vertex (0, 200);
vertex (36, 234);
vertex (0, 236);
vertex (0, 200);
endShape();

fill(255, 255, 167);
beginShape();
vertex (0, 236);
vertex (36, 234);
vertex (40, 258);
vertex (0, 236);
endShape();

fill(252, 189, 140);
beginShape();
vertex (36, 234);
vertex (98, 234);
vertex (40, 258);
vertex (36, 234);
endShape();

fill(71, 152, 128);
beginShape();
vertex (0, 236);
vertex (19, 247);
vertex (0, 259);
vertex (0, 236);
endShape();

fill(97, 201, 247);
beginShape();
vertex (0, 259);
vertex (19, 247);
vertex (19, 274);
vertex (0, 289);
vertex (0, 259);
endShape();

fill(245, 89, 188);
beginShape();
vertex (19, 247);
vertex (40, 258);
vertex (19, 274);
vertex (19, 247);
endShape();

fill(124, 237, 204);
beginShape();
vertex (40, 258);
vertex (28, 289);
vertex (0, 289);
vertex (40, 258);
endShape();

fill(245, 209, 111);
beginShape();
vertex (40, 258);
vertex (50, 290);
vertex (28, 289);
vertex (40, 258);
endShape();

fill(161, 245, 191);
beginShape();
vertex (40, 248);
vertex (73, 244);
vertex (88, 266);
vertex (50, 290);
vertex (40, 258);
endShape();

fill(202, 255, 167);
beginShape();
vertex (50, 290);
vertex (88, 266);
vertex (74, 300);
vertex (50, 290);
endShape();

fill(198, 171, 209);
beginShape();
vertex (50, 290);
vertex (74, 300);
vertex (53, 300);
vertex (50, 290);
endShape();

fill(255, 255, 167);
beginShape();
vertex (39, 300);
vertex (50, 290);
vertex (53, 300);
vertex (39, 300);
endShape();

fill(245, 89, 188);
beginShape();
vertex (18, 290);
vertex (50, 290);
vertex (39, 300);
vertex (25, 300);
vertex (18, 290);
endShape();

fill(202, 255, 167);
beginShape();
vertex (0, 289);
vertex (18, 290);
vertex (25, 300);
vertex (4, 300);
vertex (0, 289);
endShape();

fill(71, 152, 128);
beginShape();
vertex (0, 289);
vertex (4, 300);
vertex (0, 300);
vertex (0, 289);
endShape();

fill(255, 191, 249);
beginShape();
vertex (74, 300);
vertex (103, 300);
vertex (104, 289);
vertex (74, 300);
endShape();

fill(183, 118, 177);
beginShape();
vertex (74, 300);
vertex (88, 266);
vertex (132, 278);
vertex (74, 300);
endShape();

fill(97, 201, 247);
beginShape();
vertex (104, 289);
vertex (132, 278);
vertex (117, 300);
vertex (103, 300);
vertex (104, 289);
endShape();

fill(245, 209, 111);
beginShape();
vertex (88, 266);
vertex (139, 249);
vertex (132, 278);
vertex (88, 266);
endShape();

fill(161, 245, 191);
beginShape();
vertex (139, 249);
vertex (137, 217);
vertex (98, 234);
vertex (139, 249);
endShape();

fill(252, 189, 140);
beginShape();
vertex (88, 266);
vertex (98, 234);
vertex (139, 249);
vertex (88, 266);
endShape();

fill(124, 237, 204);
beginShape();
vertex (98, 234);
vertex (139, 206);
vertex (137, 217);
vertex (98, 234);
endShape();

fill(94, 156, 240);
beginShape();
vertex (98, 234);
vertex (139, 206);
vertex (69, 190);
vertex (98, 234);
endShape();

fill(255, 191, 249);
beginShape();
vertex (67, 223);
vertex (69, 190);
vertex (98, 234);
vertex (67, 223);
endShape();
fill(252, 189, 140);
beginShape();
vertex (69, 190);
vertex (128, 190);
vertex (137, 217);
vertex (69, 190);
endShape();

fill(183, 118, 177);
beginShape();
vertex (69, 190);
vertex (106, 160);
vertex (128, 190);
vertex (69, 190);
endShape();

fill(245, 209, 111);
beginShape();
vertex (54, 155);
vertex (106, 160);
vertex (69, 190);
vertex (54, 155);
endShape();

fill(198, 171, 209);
beginShape();
vertex (54, 155);
vertex (83, 132);
vertex (106, 160);
vertex (54, 155);
endShape();

fill(255, 255, 167);
beginShape();
vertex (83, 132);
vertex (97, 119);
vertex (121, 115);
vertex (106, 160);
vertex (83, 132);
endShape();

fill(245, 89, 188);
beginShape();
vertex (106, 160);
vertex (121, 115);
vertex (150, 159);
vertex (106, 160);
endShape();

fill(202, 255, 167);
beginShape();
vertex (106, 160);
vertex (150, 159);
vertex (128, 190);
vertex (106, 160);
endShape();

fill(94, 156, 240);
beginShape();
vertex (150, 159);
vertex (181, 180);
vertex (128, 190);
vertex (150, 159);
endShape();

fill(161, 245, 191);
beginShape();
vertex (137, 127);
vertex (128, 190);
vertex (181, 180);
vertex (137, 127);
endShape();

fill(97, 201, 247);
beginShape();
vertex (137, 127);
vertex (181, 180);
vertex (163, 226);
vertex (137, 127);
endShape();

fill(255, 191, 249);
beginShape();
vertex (163, 226);
vertex (181, 180);
vertex (188, 206);
vertex (163, 226);
endShape();

fill(71, 152, 12);
beginShape();
vertex (204, 258);
vertex (203, 190);
vertex (181, 180);
vertex (204, 258);
endShape();

fill(245, 89, 188);
beginShape();
vertex (181, 180);
vertex (226, 188);
vertex (224, 199);
vertex (181, 180);
endShape();

fill(198, 171, 209);
beginShape();
vertex (181, 180);
vertex (214, 171);
vertex (200, 132);
vertex (181, 180);
endShape();

fill(202, 255, 167);
beginShape();
vertex (181, 180);
vertex (200, 132);
vertex (214, 171);
vertex (181, 180);
endShape();

fill(252, 189, 140);
beginShape();
vertex (48, 128);
vertex (61, 107);
vertex (97, 119);
vertex (48, 128);
endShape();

fill(97, 201, 247);
beginShape();
vertex (181, 180);
vertex (200, 132);
vertex (171, 129);
vertex (181, 180);
endShape();

fill(183, 118, 177);
beginShape();
vertex (181, 180);
vertex (171, 129);
vertex (150, 159);
vertex (181, 180);
endShape();

fill(97, 201, 247);
beginShape();
vertex (150, 159);
vertex (121, 115);
vertex (171, 129);
vertex (150, 159);
endShape();

fill(255, 255, 167);
beginShape();
vertex (121, 115);
vertex (166, 106);
vertex (171, 129);
vertex (121, 115);
endShape();

fill(255, 191, 249);
beginShape();
vertex (166, 106);
vertex (196, 96);
vertex (171, 129);
vertex (166, 106);
endShape();

fill(183, 118, 177);
beginShape();
vertex (171, 129);
vertex (196, 96);
vertex (200, 132);
vertex (171, 129);
endShape();

fill(198, 171, 209);
beginShape();
vertex (137, 112);
vertex (125, 74);
vertex (166, 106);
vertex (137, 112);
endShape();

fill(245, 89, 188);
beginShape();
vertex (97, 119);
vertex (125, 74);
vertex (137, 112);
vertex (97, 119);
endShape();

fill(94, 156, 240);
beginShape();
vertex (97, 119);
vertex (83, 78);
vertex (125, 74);
vertex (97, 119);
endShape();

fill(245, 209, 111);
beginShape();
vertex (97, 119);
vertex (61, 107);
vertex (83, 78);
vertex (97, 119);
endShape();

fill(97, 201, 247);
beginShape();
vertex (48, 128);
vertex (97, 119);
vertex (54, 155);
vertex (48, 128);
endShape();

fill(252, 189, 140);
beginShape();
vertex (48, 128);
vertex (64, 102);
vertex (45, 85);
vertex (48, 128);
endShape();

fill(93, 242, 241);
beginShape();
vertex (64, 102);
vertex (45, 85);
vertex (83, 78);
vertex (64, 102);
endShape();

fill(202, 255, 167);
beginShape();
vertex (45, 85);
vertex (83, 31);
vertex (83, 78);
vertex (45, 85);
endShape();

fill(255, 191, 249);
beginShape();
vertex (83, 78);
vertex (119, 50);
vertex (83, 31);
vertex (83, 78);
endShape();

fill(124, 237, 204);
beginShape();
vertex (45, 85);
vertex (83, 31);
vertex (10, 63);
vertex (45, 85);
endShape();

fill(71, 152, 128);
beginShape();
vertex (36, 50);
vertex (30, 0);
vertex (83, 31);
vertex (36, 50);
endShape();

fill(255, 255, 167);
beginShape();
vertex (30, 0);
vertex (71, 0);
vertex (83, 31);
vertex (30, 0);
endShape();

fill(198, 171, 209);
beginShape();
vertex (71, 0);
vertex (100, 0);
vertex (83, 31);
vertex (71, 0);
endShape();

fill(245, 209, 111);
beginShape();
vertex (100, 0);
vertex (111, 0);
vertex (118, 10);
vertex (83, 31);
vertex (100, 0);
endShape();

fill(202, 255, 167);
beginShape();
vertex (83, 31);
vertex (118, 10);
vertex (119, 50);
vertex (83, 31);
endShape();

fill(252, 189, 140);
beginShape();
vertex (111, 0);
vertex (129, 0);
vertex (118, 10);
vertex (111, 0);
endShape();

fill(245, 89, 188);
beginShape();
vertex (118, 10);
vertex (129, 0);
vertex (141, 25);
vertex (135, 32);
vertex (118, 10);
endShape();

fill(97, 201, 247);
beginShape();
vertex (119, 50);
vertex (118, 10);
vertex (135, 32);
vertex (119, 50);
endShape();

fill(94, 156, 240);
beginShape();
vertex (83, 78);
vertex (119, 50);
vertex (125, 74);
vertex (83, 78);
endShape();

fill(71, 152, 128);
beginShape();
vertex (119, 50);
vertex (163, 0);
vertex (145, 40);
vertex (119, 50);
endShape();

fill(245, 209, 111);
beginShape();
vertex (119, 50);
vertex (145, 40);
vertex (166, 106);
vertex (125, 74);
vertex (119, 50);
endShape();

fill(255, 191, 249);
beginShape();
vertex (129, 0);
vertex (163, 0);
vertex (141, 25);
vertex (129, 0);
endShape();

fill(183, 118, 177);
beginShape();
vertex (145, 40);
vertex (163, 0);
vertex (189, 21);
vertex (145, 40);
endShape();

fill(255, 191, 249);
beginShape();
vertex (145, 40);
vertex (189, 21);
vertex (217, 55);
vertex (145, 40);
endShape();

fill(124, 237, 204);
beginShape();
vertex (145, 40);
vertex (217, 55);
vertex (151, 64);
vertex (145, 40);
endShape();

fill(255, 255, 167);
beginShape();
vertex (166, 106);
vertex (177, 61);
vertex (196, 96);
vertex (166, 106);
endShape();

fill(93, 242, 241);
beginShape();
vertex (177, 61);
vertex (217, 55);
vertex (196, 96);
vertex (177, 61);
endShape();

fill(198, 171, 209);
beginShape();
vertex (196, 96);
vertex (217, 55);
vertex (228, 74);
vertex (196, 96);
endShape();

fill(255, 191, 249);
beginShape();
vertex (196, 96);
vertex (228, 74);
vertex (243, 99);
vertex (221, 116);
vertex (196, 96);
endShape();

fill(245, 209, 111);
beginShape();
vertex (196, 96);
vertex (221, 116);
vertex (200, 132);
vertex (196, 96);
endShape();

fill(202, 255, 167);
beginShape();
vertex (200, 132);
vertex (238, 104);
vertex (257, 129);
vertex (200, 132);
endShape();

fill(94, 156, 240);
beginShape();
vertex (200, 132);
vertex (257, 129);
vertex (214, 171);
vertex (200, 232);
endShape();

fill(245, 89, 188);
beginShape();
vertex (235, 151);
vertex (224, 199);
vertex (214, 171);
vertex (235, 151);
endShape();

fill(161, 245, 191);
beginShape();
vertex (235, 151);
vertex (272, 159);
vertex (226, 188);
vertex (235, 151);
endShape();

fill(71, 152, 128);
beginShape();
vertex (235, 151);
vertex (257, 129);
vertex (272, 159);
vertex (235, 151);
endShape();

fill(198, 171, 209);
beginShape();
vertex (226, 188);
vertex (272, 159);
vertex (264, 190);
vertex (226, 188);
endShape();

fill(245, 209, 111);
beginShape();
vertex (264, 190);
vertex (272, 159);
vertex (296, 209);
vertex (264, 190);
endShape();

fill(202, 255, 167);
beginShape();
vertex (224, 199);
vertex (226, 188);
vertex (245, 190);
vertex (238, 206);
vertex (224, 199);
endShape();

fill(252, 189, 140);
beginShape();
vertex (238, 206);
vertex (245, 190);
vertex (257, 210);
vertex (232, 230);
vertex (238, 206);
endShape();

fill(255, 191, 249);
beginShape();
vertex (203, 190);
vertex (238, 206);
vertex (204, 258);
vertex (203, 190);
endShape();

fill(94, 156, 240);
beginShape();
vertex (204, 258);
vertex (238, 206);
vertex (232, 230);
vertex (260, 267);
vertex (204, 258);
endShape();

fill(202, 255, 167);
beginShape();
vertex (272, 242);
vertex (257, 210);
vertex (232, 230);
vertex (250, 251);
vertex (272, 242);
endShape();

fill(183, 118, 177);
beginShape();
vertex (163, 226);
vertex (188, 206);
vertex (204, 258);
vertex (163, 226);
endShape();

fill(161, 245, 191);
beginShape();
vertex (132, 278);
vertex (139, 249);
vertex (204, 258);
vertex (132, 278);
endShape();

fill(255, 191, 249);
beginShape();
vertex (117, 300);
vertex (132, 278);
vertex (136, 300);
vertex (117, 300);
endShape();

fill(183, 118, 177);
beginShape();
vertex (136, 300);
vertex (153, 300);
vertex (132, 278);
vertex (136, 300);
endShape();

fill(94, 156, 240);
beginShape();
vertex (132, 278);
vertex (171, 267);
vertex (153, 300);
vertex (132, 278);
endShape();

fill(252, 189, 140);
beginShape();
vertex (153, 300);
vertex (202, 300);
vertex (171, 267);
vertex (153, 300);
endShape();

fill(198, 171, 209);
beginShape();
vertex (171, 267);
vertex (204, 258);
vertex (202, 300);
vertex (171, 267);
endShape();

fill(245, 89, 188);
beginShape();
vertex (204, 258);
vertex (225, 286);
vertex (202, 300);
vertex (204, 258);
endShape();

fill(97, 201, 247);
beginShape();
vertex (204, 258);
vertex (260, 267);
vertex (225, 286);
vertex (204, 258);
endShape();

fill(245, 209, 111);
beginShape();
vertex (202, 300);
vertex (225, 286);
vertex (250, 300);
vertex (202, 300);
endShape();

fill(93, 242, 241);
beginShape();
vertex (225, 286);
vertex (260, 267);
vertex (270, 283);
vertex (250, 300);
vertex (225, 286);
endShape();

fill(71, 152, 128);
beginShape();
vertex (250, 300);
vertex (279, 278);
vertex (275, 300);
vertex (250, 300);
endShape();

fill(255, 255, 167);
beginShape();
vertex (275, 300);
vertex (279, 278);
vertex (300, 293);
vertex (289, 300);
vertex (275, 300);
endShape();

fill(124, 237, 204);
beginShape();
vertex (279, 278);
vertex (300, 265);
vertex (300, 293);
vertex (279, 278);
endShape();

fill(255, 191, 249);
beginShape();
vertex (279, 278);
vertex (300, 265);
vertex (283, 263);
vertex (279, 278);
endShape();

fill(183, 118, 177);
beginShape();
vertex (250, 250);
vertex (270, 283);
vertex (279, 278);
vertex (283, 263);
vertex (250, 250);
endShape();

fill(198, 171, 209);
beginShape();
vertex (250, 251);
vertex (292, 229);
vertex (283, 263);
vertex (250, 251);
endShape();

fill(245, 89, 188);
beginShape();
vertex (283, 263);
vertex (300, 265);
vertex (300, 241);
vertex (292, 229);
vertex (283, 263);
endShape();

fill(94, 156, 240);
beginShape();
vertex (292, 229);
vertex (300, 227);
vertex (300, 241);
vertex (292, 229);
endShape();

fill(202, 255, 167);
beginShape();
vertex (272, 242);
vertex (292, 229);
vertex (296, 209);
vertex (264, 190);
vertex (271, 202);
vertex (272, 242);
endShape();

fill(71, 152, 128);
beginShape();
vertex (292, 229);
vertex (300, 227);
vertex (300, 208);
vertex (296, 209);
vertex (292, 229);
endShape();

fill(97, 201, 247);
beginShape();
vertex (245, 190);
vertex (264, 190);
vertex (271, 202);
vertex (272, 242);
vertex (257, 210);
vertex (245, 190);
endShape();

fill(252, 189, 140);
beginShape();
vertex (296, 209);
vertex (300, 208);
vertex (300, 164);
vertex (296, 209);
endShape();

fill(93, 242, 241);
beginShape();
vertex (296, 209);
vertex (300, 164);
vertex (272, 159);
vertex (296, 209);
endShape();

fill(202, 255, 167);
beginShape();
vertex (272, 159);
vertex (300, 164);
vertex (300, 144);
vertex (272, 159);
endShape();

fill(245, 209, 111);
beginShape();
vertex (272, 159);
vertex (300, 144);
vertex (300, 109);
vertex (272, 159);
endShape();

fill(255, 255, 167);
beginShape();
vertex (257, 129);
vertex (300, 109);
vertex (272, 159);
vertex (257, 129);
endShape();

fill(198, 171, 209);
beginShape();
vertex (257, 129);
vertex (300, 109);
vertex (270, 96);
vertex (257, 129);
endShape();

fill(71, 152, 128);
beginShape();
vertex (257, 129);
vertex (238, 104);
vertex (276, 78);
vertex (257, 129);
endShape();

fill(245, 79, 188);
beginShape();
vertex (270, 96);
vertex (300, 109);
vertex (300, 82);
vertex (270, 96);
endShape();

fill(161, 245, 191);
beginShape();
vertex (276, 78);
vertex (300, 55);
vertex (300, 82);
vertex (270, 96);
vertex (276, 78);
endShape();

fill(252, 189, 140);
beginShape();
vertex (243, 99);
vertex (276, 78);
vertex (217, 55);
vertex (243, 99);
endShape();

fill(93, 242, 241);
beginShape();
vertex (257, 70);
vertex (279, 17);
vertex (300, 55);
vertex (276, 78);
vertex (257, 70);
endShape();

fill(255, 191, 249);
beginShape();
vertex (217, 55);
vertex (245, 40);
vertex (257, 70);
vertex (217, 55);
endShape();

fill(183, 118, 177);
beginShape();
vertex (245, 40);
vertex (279, 17);
vertex (257, 70);
vertex (245, 40);
endShape();

fill(202, 255, 167);
beginShape();
vertex (217, 55);
vertex (224, 7);
vertex (245, 40);
vertex (217, 55);
endShape();

fill(124, 237, 204);
beginShape();
vertex (217, 55);
vertex (189, 21);
vertex (224, 7);
vertex (217, 55);
endShape();

fill(198, 171, 209);
beginShape();
vertex (189, 21);
vertex (224, 7);
vertex (223, 0);
vertex (190, 0);
endShape();

fill(97, 201, 247);
beginShape();
vertex (223, 0);
vertex (246, 0);
vertex (252, 6);
vertex (224, 7);
endShape();

fill(71, 152, 128);
beginShape();
vertex (246, 0);
vertex (256, 0);
vertex (252, 6);
vertex (246, 0);
endShape();

fill(255, 255, 167);
beginShape();
vertex (252, 6);
vertex (256, 0);
vertex (292, 0);
vertex (300, 7);
vertex (279, 17);
vertex (252, 6);
endShape();

fill(255, 191, 249);
beginShape();
vertex (292, 0);
vertex (300, 0);
vertex (300, 7);
vertex (292, 0);
endShape();

fill(94, 156, 240);
beginShape();
vertex (279, 17);
vertex (300, 7);
vertex (300, 55);
vertex (279, 17);
endShape();

fill(252, 189, 140);
beginShape();
vertex (224, 7);
vertex (252, 6);
vertex (279, 17);
vertex (245, 40);
vertex (224, 7);
endShape();

fill(124, 239, 204);
beginShape();
vertex (163, 0);
vertex (190, 0);
vertex (189, 21);
vertex (163, 0);
endShape();

fill(245, 89, 188);
beginShape();
vertex (10, 63);
vertex (36, 50);
vertex (30, 0);
vertex (10, 63);
endShape();

fill(97, 201, 247);
beginShape();
vertex (36, 234);
vertex (98, 234);
vertex (50, 126);
vertex (36, 234);
endShape();

fill(71, 152, 128);
beginShape();
vertex (73, 244);
vertex (98, 234);
vertex (88, 266);
vertex (73, 244);
endShape();

fill(183, 118, 177);
beginShape();
vertex (26, 207);
vertex (50, 126);
vertex (36, 234);
vertex (26, 207);
endShape();

fill(255, 191, 249);
beginShape();
vertex (163, 226);
vertex (188, 206);
vertex (204, 258);
vertex (163, 226);
endShape();

fill(183, 118, 177);
beginShape();
vertex (26, 207);
vertex (50, 126);
vertex (36, 234);
vertex (26, 207);
endShape();

fill(252, 189, 140);
beginShape();
vertex (163, 226);
vertex (204, 258);
vertex (139, 249);
vertex (163, 226);
endShape();

fill(255, 255, 167);
beginShape();
vertex (139, 249);
vertex (163, 226);
vertex (137, 217);
vertex (139, 249);
endShape();

fill(94, 156, 240);
beginShape();
vertex (136, 216);
vertex (128, 190);
vertex (181, 180);
vertex (136, 216);
endShape();

fill(71, 152, 128);
beginShape();
vertex (289, 300);
vertex (300, 293);
vertex (300, 300);
vertex (289, 300);
endShape();

fill(245, 89, 188);
beginShape();
vertex (181, 180);
vertex (214, 171);
vertex (224, 199);
vertex (181, 180);
endShape();

fill(198, 171, 209);
beginShape();
vertex (151, 64);
vertex (177, 61);
vertex (166, 106);
vertex (151, 64);
endShape();

fill(93, 242, 241);
beginShape();
vertex (214, 171);
vertex (200, 132);
vertex (181, 180);
vertex (214, 171);
endShape();

fill(202, 255, 167);
beginShape();
vertex (163, 226);
vertex (181, 180);
vertex (137, 217);
vertex (163, 226);
endShape();

translate(50, 50);
noFill();
stroke(0, 0, 0);
strokeWeight(13);
strokeJoin(MITER);

beginShape();
vertex (34, 56);
vertex (55, 34);
vertex (100, 78);
vertex (144, 34);
vertex (166, 55);
vertex (122, 100);
vertex (166, 145);
vertex (145, 166);
vertex (100, 122);
vertex (55, 166);
vertex (33, 145);
vertex (77, 100);
vertex (34, 56);
endShape();

</pre>

 

Para a composição animada, com a ajuda de codigos ja existentes na internet e de tutoriais, criei um conjunto de circulos que estão em constante movimento, com o efeito de desvanecer. Quando arrastamos o rato por cima da imagem é criado um rasto e quando clicamos durante uns segundos,os circulos vibram.

Sem títhdoifhulo      Sem jbiubtítulo

<pre>

float t = 0, dt = 0.05;
float kz = 0;

float mt = 0;

float mx, my;

float ampsize = 0;
boolean ampwait = false;

class Wave {
float x, y;
float amp;
float it;

Wave(float xx, float yy, float aa, float st) {
x = xx;
y = yy;
amp = aa;

it = st;
}

float get(float px, float py) {
float r = dist(x, y, px, py);

float ph = 15 * ((t – it – 0.1) – r);

return amp * sin(ph) / ph;
}

float geta(float px, float py) {
//float a = atan2(py – y, px – x);
float a = atan2(px – x, y – py);

return a;
}
}

ArrayList waves;

void setup() {
size(400, 400);
colorMode(HSB, TWO_PI, 1.0, 1.0, 1.0);
background(0);
smooth();

waves = new ArrayList();
}

void draw() {
/*translate(width / 2, height / 2);
rotate(t);*/

int k = 0;
while (k < waves.size()) {
Wave w = (Wave) waves.get(k);

if (t – w.it > 4) waves.remove(k);

k ++;
}

mx = map(mouseX, 0, width, -1, 1);
my = map(mouseY, 0, height, -1, 1);

randomSeed(131);

clear();
for (int i = 0; i < 1000; i++) {
particle();
}

if (ampwait) ampsize += 0.01;

t += dt;
mt += dt;

if (mt > 2.1) {
mt = 0;

randomSeed((int) (cos(t) * 1000));
waves.add(new Wave(
random(-1, 1),
random(-1, 1),
random(0.005, 0.01),
t
));
}
}

void particle() {
float ar = random(0, 0.1);
float aa = random(0, TWO_PI);
float af = random(0, 5);

float x = random(-1, 1) + ar * cos(aa + af * t);
float y = random(-1, 1) + ar * sin(aa + af * t);
float z = 1;

for(int i = 0; i < waves.size(); i++) {
Wave w = (Wave) waves.get(i);

float h = w.get(x, y);
float a = w.geta(x, y);

x += h * cos(a);
y += h * sin(a);
z += h;
}

float px = map(x, -1, 1, 0, width);
float py = map(y, -1, 1, 0, height);
float pz = random(3, 45);

//pz = random(1,10);

float alph = dist(mx, my, x, y) / 8;

stroke(atan2(y, x) + PI, 0.7, 0, alph);
//noStroke();
noFill();
ellipse(px, py, pz, pz);
}

void clear() {
fill(0, 0, 1, 0.2);
rect(0, 0, width, height);
}

void mousePressed() {
ampsize = 0.02;
ampwait = true;
}

void mouseReleased() {
ampwait = false;

waves.add(new Wave(
map(mouseX, 0, width, -1, 1),
map(mouseY, 0, height, -1, 1),
ampsize, t));
}

</pre>

Anúncios

One comment

Deixe uma Resposta

Preencha os seus detalhes abaixo ou clique num ícone para iniciar sessão:

Logótipo da WordPress.com

Está a comentar usando a sua conta WordPress.com Terminar Sessão /  Alterar )

Google+ photo

Está a comentar usando a sua conta Google+ Terminar Sessão /  Alterar )

Imagem do Twitter

Está a comentar usando a sua conta Twitter Terminar Sessão /  Alterar )

Facebook photo

Está a comentar usando a sua conta Facebook Terminar Sessão /  Alterar )

Connecting to %s