xxxxxxxxxx
float beta = 0;
ArrayList<PVector> points = new ArrayList<PVector>();
var p;
var q;
var t;
var u;
var l;
void setup() {
size(960, 540, P3D);
colorMode(HSB, 2, 2, l);
p = 0.5;
q = 0.30;
t = 0;
u = 2;
l = 4;
textFont('Roboto Mono');
}
void draw() {
background(0, 0, 0);
if (key == 'p') {
textFont('Roboto Mono');
textSize(18);
text("Yunka Uywa (math formula: - r = 250 * (0.8 + 1 * sin(6 * β ))θ = 1 + 1.5 + t * β = 0.6 * π * sin(3 * beta))", 25, 60);
}
if (key == 'x') {
textSize(15);
text(" huk yunka puma rikurin(math formula: - r = 250 * (0.9 + 2 * sin(6 * β ))θ = 2 + 2.5 + t * β = 0.6 * π * sin(3.5 * beta))", 25, 60);
}
if (key == 'w') {
textSize(15);
text("huk yunka puma rikurin huk qipanpi (math formula: - r = 250 * (0.11 + 2.4 * sin(6 * β ))θ = 5 + 5.5 + t * β = 0.6 * π * sin(8.5 * beta))", 25, 60);
}
translate(width/2, height/2, -500);
rotateY(frameCount*0.01);
rotateX(frameCount*0.001);
float r = 250 * ( 0.8 + p * sin(6 * beta));
float theta = p+q+t * beta; // NUDO1
float phi = 0.6 * PI * sin(3 * beta);
float x = r * cos(phi) * cos(theta);
float y = r * cos(phi) * sin(theta);
float z = r * sin(phi);
points.add(new PVector(x, y, z));
beta += 0.002;
noFill();
strokeWeight(8);
beginShape();
for (PVector point : points) {
float m = point.mag();
stroke((m*0.5)%l, t, u);
vertex(point.x, point.y, point.z);
}
endShape();
}
void reset() {
background(255, 255, 0);
translate(width/2, height/2, -500);
rotateY(frameCount*0.01);
rotateX(frameCount*0.001);
float r = 250 * ( 0.8 + p * sin(6 * beta));
float theta = p+q+t * beta; // NUDO1
float phi = 0.6 * PI * sin(3 * beta);
float x = r * cos(phi) * cos(theta);
float y = r * cos(phi) * sin(theta);
float z = r * sin(phi);
points.add(new PVector(x, y, z));
beta += 0.002;
noFill();
strokeWeight(8);
beginShape();
for (PVector point : points) {
float m = point.mag();
stroke((m*0.5)%l, t, u);
vertex(point.x, point.y, point.z);
}
endShape();
}
void keyPressed() {
if (key == 'x') {
q += 20;
t += 30;
textSize(32);
//yunka uywa
//huk yunka puma
// huk yunka puma rikurin huk condorpa qipanpi
} else if (key == 'q') {
q += 2;
u += 30;
} else if (key == 'o') {
p -= 2;
} else if (key == 'w') {
q -= 2;
l += 30;
}
}