void setup(){
size(1000,1000,P3D);
}
void draw(){
noStroke();
fill(0, 20);
rect(0, 0, width, height);
pushMatrix();
pushStyle();
translate(500, 500);
rotate(PI/2 + PI/2);
rectMode(CENTER);
rect(0, 0, 100, 400);
popStyle();
popMatrix();
}
If I understand correctly, translate(500,500) will translate (0,0) into position (500,500). rotate(PI/2 + PI/2) will rotate the coordinate system clock-wise for PI radians, then a rectangle with respect to this new coordinate system is drawn, with center (0,0), width and height 100 and 400. When I tried the above code, I did see the rectangle, it disappeared and then with a black screen. Could anyone please let me know how to understand this?