I'm trying to rotate three-faced object around its center via X axis. I'm building single face's center at 0,0. And I can rotate it around its center, but when I try to rotate the "whole" object, it doesn't work anymore. What should I do?
float a = 0;
void setup() {
size(400, 400, P3D);
}
void draw() {
background(0);
noStroke();
lights();
pushMatrix();
translate(width/2, height/2, -100);
a = a + 0.01;
rotateX(a);
beginShape(QUADS);
vertex(-100, -100, 0);
vertex(100, -100, 0);
vertex(100, 100, 0);
vertex(-100, 100, 0);
vertex(-100, 100, 0);
vertex(100, 100, 0);
vertex(100, 0, - 170);
vertex(-100, 0, - 170);
vertex(-100, - 100, 0);
vertex(100, - 100, 0);
vertex(100, 0, - 170);
vertex(-100, 0, - 170);
endShape();
popMatrix();
}