xxxxxxxxxx
63
var n = 3;
var c = 3;
var seeds = [];
function setup() {
createCanvas(500, 500); //because i like making phone backgrounds
angleMode(DEGREES);
background('#FAF9F6');
}
// gets called 60fps
function draw() {
translate(width / 2, height / 2);
var angle = n * 137.5; // play here! this
var radius = c * sqrt(n);
var x = radius * cos(angle)/QUARTER_PI;
var y = radius * sin(angle)/PI;
// generate random number
// let r = random();
// if (r < 0.33) {
fill('black');
// } else if(r > 0.33 || r < 0.66) {
// fill('pink');
// } else if(r > 0.66) {
// fill('white');
// }
noStroke();
// ellipse(x, y, 4 * sin(n), 5 * sin(n+2));
// n+3;
ellipse(x*QUARTER_PI, y+5, 1 * sin(n), 200 * sin(n+5));
// ellipse(x*QUARTER_PI, y+5, 5, 5 );
n++;
c += 0; //play here! this will dynamically change the spacing. try c += sin(n)
// noLoop();
rotate(n);
}
// THINGS TO TRY
// play around with n and/or c
// change the color based on position or order
// change the size of the seeds based on position/order
// change the seed size after a certain n
// random colors
// build your flower with other shapes
// Build your flower with letters or images instead of ellipses
// animate the flower in draw() after placing the leaves in a setup() loop
// connect leaves
// can you make something that looks like a romanesco broccoli
// REMINDER to takes lots of pictures of WIP flowers. Right click and downlaod to share