I’m super new to processing. How do I make my flower shape grow or make it look like it’s “blooming”? The size it is now is the max size I want, but how do I make it so it starts from a 0 size to grow into that?
void setup() {
size(600, 600);
frameRate(4);
}
void draw() {
if (mousePressed) {
drawFlower(mouseX, mouseY);
}
}
void keyPressed() {
background(180);
drawFlower(100, 80);
}
void drawFlower(float posx, float posy) {
pushMatrix();
translate(posx, posy);
fill(255,255, 255, 200);
stroke(255,255, 255, 200);
beginShape();
int n = 6;
for (int i = 0; i < n; i++) {
float a = map(i, 0, n, 0, TWO_PI);
float a1 = map(i + 1, 0, n, 0, TWO_PI);
float r = 60;
float x = r * cos(a);
float y = r * sin(a);
float x1 = r * cos(a1);
float y1 = r * sin(a1);
vertex(0, 0);
bezierVertex(x, y, x1, y1, 0, 0);
}
endShape();
popMatrix();
}