// I would like to express the rose using simple shapes // I tried to give a strong impression by drawing a color and black in turn // By rotation of ellipses and rectangles, I wanted to express dynamism // // Title: Digital Rose // // setup size(400,400); background(0); smooth(); float a; float inc; float x1, x2, x3, x4; float y1, y2, y3, y4; float rad; int col = #a00000; int fil = 1; // petal a = PI/4.0; inc = TWO_PI/25.0; rad = 300; col = #a00000; for (int i = 0;i < 70; i=i+8) { x1 = sin(a) * rad; y1 = cos(a) * rad; x2 = sin(a+PI/2) * rad; y2 = cos(a+PI/2) * rad; x3 = sin(a+PI) * rad; y3 = cos(a+PI) * rad; x4 = sin(a-PI/2) * rad; y4 = cos(a-PI/2) * rad; fill(col); if (fil == 1) { fill(0); fil = 0; } else { fill(col); fil = 1; } quad(x1+200, y1+200, x2+200, y2+200, x3+200, y3+200, x4+200, y4+200); a = a + inc; rad = rad*0.82; col = col + 0x001010; } // pistil rad = 27; col = #FF8408; for (int i = 0;i < 100; i=i+4) { x1 = sin(a) * rad; y1 = cos(a) * rad; if (fil == 0) { fill(0); fil = 1; } else { fill(col); fil = 0; col = col + 0x000808; } ellipse(x1+200, y1+200, rad, rad); a = a + inc; } fill(#FF8408); beginShape(); vertex(196, 159); vertex(206, 163); vertex(209, 166); vertex(212, 174); vertex(209, 181); vertex(198, 190); vertex(205, 175); vertex(200, 166); vertex(193, 160); endShape(); // leaf fill(#095F2A); triangle(0, 350, 0, 399, 40, 399); triangle(399, 350, 399, 399, 350, 399); triangle(0, 0, 49, 0, 0, 49); triangle(350, 0, 399, 0, 399, 49);