I am trying to reproduce the example “Sine Cosine in 3D” from the site at the beginning of the skecht.
I show you how far I have come. But it is very far from reproducing the p5js skecht.
Could you guide me to reach the goal?
//https://p5js.org/examples/3d-sine-cosine-in-3d.html
void setup() {
size(710, 710, P3D);
}
void draw() {
background(250);
strokeWeight(1.5);
rotateX(frameCount * 0.01);
for (int j = 0; j < 5; j++) {
push();
for (int i = 0; i < 80; i++) {
translate(
sin(frameCount * 0.001 + j) * 100,
sin(frameCount * 0.001 + j) * 100,
i * 0.1
);
rotateZ(frameCount * 0.002);
push();
//translate(width,height,0);
sphere(1);
pop();
}
pop();
}
}