What rotations are performed to produce this output on a Tesseract? I'm writing a program that projects a tesseract in 3D on a 2D environment and I want to reproduce the rotation of this gif but I'm having difficulty grasping what rotations before projection I need to apply. An explanation of how to get to my desired rotation matrix using terms like axis rotation would be helpful.
What are the rotations performed on the tesseract?
 A: What you see in the linked video is a Clifford rotation,
a rotation parallel to one plane with a
simultaneous rotation parallel to another plane orthogonal to the first one.
(In four dimensions we don't just have lines orthogonal to planes, we have entire planes orthogonal to other planes.)
There is an explanation and another demonstration of a Clifford rotation on this page.
If you visualize the video as a three-dimensional projection of a rotating tesseract,
you may notice that there are four square faces within the tesseract that always remain parallel to a fixed plane in the three-dimensional projection space.
Each of these square faces moves in a cycle from the left side of the picture
(somewhat toward the rear), squeezing through the middle of the figure to the right side (somewhat toward the front), and then stretching around the outside of the figure while traveling back to the left.
While doing this, each square also rotates in its own plane.
If you assign the first two coordinate axes to a plane parallel to these shrinking, stretching, rotating squares,
those coordinates determine one plane of the Clifford rotation,
and the other two axes determine the other plane of the rotation.
Setting the origin of coordinates at the center of the tesseract
(which is the one point that does not move),
the rotation matrix at any instant in time would look something like the following,
where $t$ is the time since the start of movement (or any other arbitrary moment in time of your choice) and $a,$ $b,$ $c,$ and $d$ are constants:
$$\begin{pmatrix}
\cos(at + b) & \sin(at + b) & 0 & 0 \\
-\sin(at + b) & \cos(at + b) & 0 & 0 \\
0 & 0 & \cos(ct + d) & \sin(ct + d) \\
0 & 0 & -\sin(ct + d) & \cos(ct + d)
\end{pmatrix}$$
The constants $a$ and $c$ determine the two rates of rotation and the constants $b$ and $d$ determine the phase of each rotation, that is, they let you put one rotation a fixed amount ahead of the other.
From viewing the video I suspect you can get the desired effect with $a = c \neq 0$ and $b = d = 0.$
