xxxxxxxxxx
25
let pts;
function setup() {
createCanvas(600, 600, WEBGL);
pts = [];
let r = 250;
for (let t2 = 0; t2 < TWO_PI; t2 += PI / 16) {
for (let t = 0; t < TWO_PI; t += PI / 16) {
let x = r * sin(t) * cos(t2);
let y = r * sin(t) * sin(t2);
let z = r * cos(t);
pts.push(createVector(x,y,z))
}
}
}
function draw() {
orbitControl();
background(220);
stroke(20);
for (let p of pts) point(p.x, p.y, p.z)
}