xxxxxxxxxx
44
let r, num, img
let points = []
function setup() {
img = createCanvas(windowWidth,windowHeight);
angleMode(DEGREES)
strokeWeight(10)
r = 200
num =10
for (let i = 0; i < num *360; i++) {
let pr = r* sqrt(random())
let x = pr * cos(i)
let y = pr * sin(i)
points.push({
x,
y
})
}
// for (let i = 0; i < width; i+=10) {
// for (let j = 0; j < height; j+=10) {
// let x =i
// let y=j
// points.push({
// x,
// y
// })
// }}
}
function draw() {
background(255);
translate(width / 2, height / 2)
for (let p of points) {
let n = noise(p.x/50,p.y/50, frameCount/10)
stroke(0,map(n,0,1,-50,255))
point(p.x+random(-1,1), p.y+random(-1,1))
}
}
function keyTyped() {
if (key === 's') {
saveCanvas(img, 'c_logo_v3', 'png');
}
}