Tengo 2 objetos 3D, un toro y un cilindro. Quiero que el cilindro quede encima del toro, en lugar de debajo.
function setup() { createCanvas(400, 400, WEBGL); } function draw() { angleMode(DEGREES) background(220); noStroke(); rotateX(30) // The torus // The color(Torus) fill(241, 177, 102); // Drawing the Torus torus(100, 40); // The Cylinder // The color fill(138, 78, 27); // Drawing the cylinder push(); rotateX(90); cylinder(130, 10); pop(); } <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/p5.js"></script>En este dibujo, el cilindro parecerá más obvio, ya que esta vez está de lado en lugar de estar plano como si fuera un círculo. Esto es simplemente para que sea más fácil ver y entender lo que quiero decir.
function setup() { createCanvas(400, 400, WEBGL); } function draw() { angleMode(DEGREES) background(220); noStroke(); // rotateX(30) // The torus // The color(Torus) fill(241, 177, 102); // Drawing the Torus torus(100, 40); // The Cylinder // The color fill(138, 78, 27); // Drawing the cylinder // push(); // rotateX(90); cylinder(130, 10); // pop(); } <script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/1.4.1/p5.js"></script>Hasta ahora, he intentado rotar el cilindro sobre el eje Z, pero no funcionó, y también intenté dibujar el cilindro antes del toro, pero tampoco funcionó.