line surrounding sphere
@author
float radious = 200;
float radian;
void setup(){
size(500, 500, P3D);
noFill();
strokeWeight(2);
stroke(0, 150);
radian = 0.0;
}
void draw(){
background(255);
translate(width / 2, height / 2, -100);
rotateZ(map(mouseX, 0, width, -PI / 3, PI / 3));
rotateX(map(mouseY, 0, height, -PI / 3, PI / 3));
beginShape();
float r = radian;
for(float y = -radious; y <= radious; y += 0.3){
float x = radious * cos(r) * cos(asin(abs(y / radious)));
float z = radious * sin(r) * cos(asin(abs(y / radious)));
vertex(x, y, z);
r += PI / 16;
}
endShape();
radian += PI / 32;
if(radian > TWO_PI){
radian -= TWO_PI;
}
}