xxxxxxxxxx
79
var n = 0;
var c = 5;
var seeds = [];
function setup() {
createCanvas(450, 800); //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) + width/20;
var y = radius * sin(angle + height/20);
// for(let i = 0; i < 1000; i++) {
// let angle = i * 137.5;
// let radius = c * sqrt(i);
// let x = radius * cos(angle) + width/200;
// let y = radius * sin(angle) + height/200;
strokeWeight(0.3);
noFill();
stroke('black');
ellipse(x/QUARTER_PI, y*3, 5+ cos(n), 5+sin(n));
n++;
frameRate(29);
// }
// generate random number
// let r = random();
// if (r < 0.33) {
// // fill('red');
// stroke('red');
// strokeWeight(.8);
// } else if(r > 0.33 || r < 0.66) {
// stroke('pink');
// strokeWeight(0.2);
// } else if(r > 0.66) {
// fill('white');
// }
// noStroke();
// ellipse(x, y, 4 * sin(n), 5 * sin(n+0.5));
// n++;
// c += 1; //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