xxxxxxxxxx
61
var n = 2;
var c = 5;
var seeds = [];
function setup() {
createCanvas(450, 800); //because i like making phone backgrounds
angleMode(DEGREES);
background('white');
}
// gets called 60fps
function draw() {
translate(width / 2, height / 2);
// fill('pink')
// ellipse(x,y,200,200)
var angle = n * 365; // play here! this
var radius = c * sqrt(n);
var x = radius * cos(angle);
var y = radius * sin(angle);
// generate random number
let r = random();
if (r < 0.33) {
fill('black');
} else if(r > 0.33 || r < 0.66) {
fill('white');
} else if(r > 0.66) {
fill('white');
}
noStroke();
line(x+20, y=, x * sin(n), y * sin(n+0.5));
n++;
c += 0; //play here! this will dynamically change the spacing. try c += sin(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