xxxxxxxxxx
41
let r = 200;
function setup(){
createCanvas(700,700, WEBGL);
angleMode(DEGREES) // degrees for easier calculations
colorMode(HSB);
frameRate(30)
stroke(199, 80, 88)
strokeWeight(3)
noFill()
}
function draw(){
rotateX(frameCount%360)
rotateY(frameCount%360)
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
beginShape(POINTS);
for(let a2 = 0; a2<360; a2 += 5){ //a2 = theta
let rtx = 25000
let x = r * (1+1*sin(a2*6)*cos(a1*9))*cos(a1)
let y = r * (1+1*sin(a2*6)*cos(a1*9))*sin(a1) * sin(a2);
let z = r * (1+1*sin(a2*6)*cos(a1*9))*sin(a1) * cos(a2);
vertex(x,y,z)
}
endShape(CLOSE)
}
}