xxxxxxxxxx
38
let data = [];
function setup() {
createCanvas(800, 400);
noStroke();
generateData();
noLoop();
}
function draw() {
background(240);
for (let point of data) {
let x = map(point.x, 0, 1, 100, width - 100);
let y = map(point.y, 0, 1, height - 100, 100);
let size = point.size * 50;
// Create colorful, dynamic shapes
let r = random(255);
let g = random(255);
let b = random(255);
fill(r, g, b, 100); // Add transparency for an artistic effect
// Draw shapes (you can experiment with different shapes)
ellipse(x, y, size, size);
}
}
function generateData() {
// Generate random data points
for (let i = 0; i < 100; i++) {
let x = random();
let y = random();
let size = random();
data.push({ x, y, size });
}
}