My post was about rotation only around Y. For X and Z you just need to swap out the X and Y for X/Y/Z as necessary and then remember to perform the rotations in the correct order.
Usually X, then Y, then Z.
Or you can use a quaternion.
Point is, because the rotations are in 90 degree increments, the coordinates just exchange places with each other with the occasional -1