The Theory behind this animation
Euler Equation:
$$I\vec{\dot{\omega}}+\vec{\omega}\times (I\,\vec{\omega})=0$$
with :
$$I=\left[ \begin {array}{ccc} T_{{x}}&0&0\\ 0&T_{{y}}&0
\\ 0&0&T_{{y}}\end {array} \right]$$
$$\vec\omega=\left[ \begin {array}{c} \omega_{{x}}\\ \omega_{{y}
}\\ \omega_{{z}}\end {array} \right]
$$
with the initial conditions
$~\omega_x(0)=\omega_{x0}~,~\omega_y(0)=\omega_{y0}~,~\omega_z(0)=\omega_{z0}~$
you can obtain the solution for $~\vec{\omega}(\tau)$
$$\omega_x(\tau)=\omega_{x0}$$
$$\omega_y(\tau)=-\omega_{{{ z0}}}\sin \left( {\frac {\omega_{{{ x0}}} \left( -T_
{{y}}+T_{{x}} \right) \tau}{T_{{y}}}} \right) +\omega_{{{ y0}}}\cos
\left( {\frac {\omega_{{{ x0}}} \left( -T_{{y}}+T_{{x}} \right)
\tau}{T_{{y}}}} \right)
$$
$$\omega_z(\tau)=\omega_{{{ z0}}}\cos \left( {\frac {\omega_{{{ x0}}} \left( -T_{
{y}}+T_{{x}} \right) \tau}{T_{{y}}}} \right) +\omega_{{{ y0}}}\sin
\left( {\frac {\omega_{{{ x0}}} \left( -T_{{y}}+T_{{x}} \right)
\tau}{T_{{y}}}} \right)
$$
Rotation Matrix
The rotation matrix between the body and inertial system is:
$$S= \left[ \begin {array}{ccc} 1&0&0\\ 0&\cos \left(
\varphi \right) &-\sin \left( \varphi \right) \\ 0
&\sin \left( \varphi \right) &\cos \left( \varphi \right)
\end {array} \right]
\,\left[ \begin {array}{ccc} \cos \left( \vartheta \right) &0&\sin
\left( \vartheta \right) \\ 0&1&0
\\ -\sin \left( \vartheta \right) &0&\cos \left(
\vartheta \right) \end {array} \right]
\, \left[ \begin {array}{ccc} \cos \left( \psi \right) &-\sin \left(
\psi \right) &0\\ \sin \left( \psi \right) &\cos
\left( \psi \right) &0\\ 0&0&1\end {array} \right]
$$
from here you get the equation:
$$\left[ \begin {array}{c} \dot\varphi \\ \dot\vartheta
\\ \dot\psi \end {array} \right]
= \left[ \begin {array}{ccc} {\frac {\cos \left( \psi \right) }{\cos
\left( \vartheta \right) }}&-{\frac {\sin \left( \psi \right) }{\cos
\left( \vartheta \right) }}&0\\ \sin \left( \psi
\right) &\cos \left( \psi \right) &0\\ -{\frac {
\sin \left( \vartheta \right) \cos \left( \psi \right) }{\cos \left(
\vartheta \right) }}&{\frac {\sin \left( \vartheta \right) \sin
\left( \psi \right) }{\cos \left( \vartheta \right) }}&1\end {array}
\right] \,\left[ \begin {array}{c} \omega_{{x}}\\ \omega_{{y}
}\\ \omega_{{z}}\end {array} \right]
$$
you don't have analytical solution for this ODE, you have to solve it numerical after that you obtain
$~\varphi(\tau)~,\vartheta(\tau)~,\psi(\tau)~$ so you can animate the rigid body with the rotation matrix $~S=S(\tau)$