Sequence of rotation

It seems incorrect that translations are independent. Consider the following example that generates different outcomes depending on the rotation order:

void setup() {
  //pixelDensity(2);
  size(400, 400, P3D);
  rectMode(CENTER);
  background(90);
}

void draw() {
  translate(width/2, height/2);

  // XY order
  pushMatrix();
  fill(255,0,0);
  rotateX(90);
  rotateY(90);
  //rect(0, 0, 100, 100);
  //noFill();
  box(50, 150, 100);
  popMatrix();
  
  // YX order
  pushMatrix();
  fill(0,255,0);
  rotateY(90);
  rotateX(90);
  //rect(0, 0, 100, 100);
  //noFill();
  box(50, 150, 100);
  popMatrix();
}

The result is visible in the following image:

Hence I believe the reply above by @jeremydouglass and @TfGuy44 to be incorrect. Please correct me if I misunderstood.

2 Likes