Skip to content

Instantly share code, notes, and snippets.

@kuzemkon
Created September 27, 2014 21:10
Show Gist options
  • Save kuzemkon/d3cd72d3f4d5dcd263b9 to your computer and use it in GitHub Desktop.
Save kuzemkon/d3cd72d3f4d5dcd263b9 to your computer and use it in GitHub Desktop.
float a;
void setup()
{
size(600,600);
}
void petal() {
beginShape();
curveVertex(0, 0);
curveVertex(0, 0);
curveVertex(100, 32);
curveVertex(150, 0);
curveVertex(100, -32);
curveVertex(0, 0);
curveVertex(0, 0);
endShape();
}
void draw()
{
pushMatrix();
background(255);
a++;
if(a>1100)
a = 0;
translate(-520+a,0);
pushMatrix();
translate(150,230);
stroke(0,100,0);
noFill();
gip();
popMatrix();
pushMatrix();
translate(420, 205);
for(int i=0; i<8; i++) {
rotate(PI/4);
fill(200, 0, 0);
stroke(200, 0, 0);
petal();
}
fill(217, 245, 129);
stroke(217, 245, 129);
ellipse(0, 0, 50, 50);
popMatrix();
pushMatrix();
translate(100,200);
rotate(-PI/9);
stroke(0,100,0);
fill(0,150,0);
lystok();
popMatrix();
pushMatrix();
translate(100,200);
stroke(0,100,0);
noFill();
steblo();
popMatrix();
pushMatrix();
translate(150,350);
rotate(-PI/7);
stroke(0,100,0);
noFill();
zalupky();
popMatrix();
pushMatrix();
translate(160,390);
rotate(-PI/8);
stroke(0,100,0);
noFill();
zalupky();
popMatrix();
pushMatrix();
translate(135,300);
rotate(-PI/6);
stroke(0,100,0);
noFill();
kentavr();
popMatrix();
popMatrix();
}
void steblo()
{
beginShape();
curveVertex(0,0);
curveVertex(0,0);
curveVertex(50,100);
curveVertex(100,300);
curveVertex(120,350);
curveVertex(140,400);
endShape();
}
void lystok() {
beginShape();
curveVertex(0,0);
curveVertex(0,0);
curveVertex(50,175);
curveVertex(0,250);
curveVertex(-50,175);
curveVertex(0,0);
curveVertex(0,0);
endShape();
}
void zalupky() {
beginShape();
curveVertex(50,0);
curveVertex(50,0);
curveVertex(25,25);
curveVertex(0,20);
curveVertex(-25,-25);
curveVertex(-50,0);
endShape();
}
void kentavr() {
beginShape();
curveVertex(35,0);
curveVertex(35,0);
curveVertex(25,25);
curveVertex(0,20);
curveVertex(-25,-25);
curveVertex(-35,0);
endShape();
}
void gip() {
beginShape();
curveVertex(0,200);
curveVertex(25,150);
curveVertex(75,75);
curveVertex(150,25);
curveVertex(200,5);
curveVertex(300,-20);
endShape();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment