xxxxxxxxxx
44
let scale = 0.008;
let circleSize = 20;
let circleSpacing = 30;
function setup() {
createCanvas(600, 400);
background(0);
fill(0, 0, 255);
// for (starting condition; ending condition; change)
let globalIndex = 0;
for (let y = circleSpacing; y < height; y = y + circleSpacing) {
for (let x = circleSpacing; x < width; x = x + circleSpacing) {
// get a 'noise' value at this x,y position
// we will use this value to rotate and scale the circles
var noiseValue = noise(x * scale, y * scale, 0);
//
var v = p5.Vector.fromAngle(noiseValue);
v.setMag(1);
push();
translate(x, y);
rotate(v.heading());
ellipse(0, 0, circleSize, circleSize * noiseValue);
pop();
}
}
// for (let myBook = 0; myBook < 5; myBook += 1) {
// console.log("I am reading book: ", myBook);
// // read all of the pages in the book
// for (let myPage = 0; myPage < 3; myPage += 1) {
// console.log("I am on page:", myPage);
// }
// console.log('I am finished reading book:', myBook);
// console.log('---------------------------')
// }
}