xxxxxxxxxx
39
let r = 200;
function setup(){
createCanvas(700,700, WEBGL);
angleMode(DEGREES) // degrees for easier calculations
colorMode(HSB);
stroke(199, 80, 88)
strokeWeight(3)
noFill()
}
function draw(){
background(230,50,15)
orbitControl(4,4) // allows rotation + value 4 is for the speed of the rotation or perhaps how much the camera rotates per "mouse swipe"
for(let a1 = 0; a1 < 180; a1 += 5 ){ //a1 = phi
for(let a2 = 0; a2<360; a2 += 5){//a2 = theta
let x = r * cos(a1)
let y = r * sin(a1) * sin(a2);
let z = r * sin(a1) * cos(a2);
point(x,y,z)
}
}
}