xxxxxxxxxx
50
let r1 = 100; let r2 = 50;
let phi2 = 0; let angle = 0; let angle2 = 0;
let rez = 10;
function setup() {
createCanvas(400, 400, WEBGL);
angleMode(DEGREES);
}
function draw() {
background('#D03994');
rotateX(45 + angle2);
rotateY(angle2);
// rotateX(45);
noFill();
let i=0;
for(let theta=0; theta<360; theta+=rez) {
beginShape(POINTS);
strokeWeight(6);
stroke(255);
for (let phi= i + 30; phi< i + 31; phi++) {
let x = (r1 + r2*cos(phi + angle))*cos(theta);
let y = (r1 + r2*cos(phi + angle))*sin(theta);
let z = r2*sin(phi + angle);
vertex(x, y, z);
}
endShape();
beginShape(LINES);
strokeWeight(1);
stroke(255);
for (let phi= i + 0; phi< i + 225; phi+=3) {
let x = (r1 + r2*cos(phi + angle))*cos(theta);
let y = (r1 + r2*cos(phi + angle))*sin(theta);
let z = r2*sin(phi + angle);
vertex(x, y, z);
}
endShape();
i+= 10;
}
angle += 1;
}