I wanted to generate the general rotation transformation matrix ($3D$).
But when I did the multiplication the result didn't include the original $Z$ coordinates,I don't know why the $Z$ disappeared.
$$ \begin{align} &\begin{bmatrix} \cos \alpha & -\sin \alpha & 0 \\ \sin \alpha & \cos \alpha & 0 \\ 0 & 0 & 1 \end{bmatrix}.\begin{bmatrix} \cos \beta & 0 & \sin \beta \\ 0 & 1 & 0 \\ -\sin \beta & 0 & \cos \beta \end{bmatrix}.\begin{bmatrix} 1 & 0 & 0 \\ 0 & \cos \theta & -\sin \theta \\ 0 & \sin \theta & \cos \theta \end{bmatrix}.\begin{bmatrix} X \\ Y \\ Z \end{bmatrix}= \\ &\begin{bmatrix} x\cos \left( \alpha \right) \cos \left( \beta \right) +y\left( -\sin \left( \alpha \right) \cos \left( \theta \right) +\sin \left( \beta \right) \sin \left( \theta \right) \cos \left( \alpha \right) \right) \\ x\sin \left( \alpha \right) \cos \left( \beta \right) +y\left( \sin \left( \alpha \right) \sin \left( \beta \right) \sin \left( \theta \right) +\cos \left( \alpha \right) \cos \left( \theta \right) \right) \\ -x\sin \left( \beta \right) +y\sin \left( \theta \right) \end{bmatrix} \end{align} $$
As you can see I multiplied the transformation matrix by the order $X,Y,Z$ and then I multiplied it by by the variables of the coordinates of the point.
But the result don't have the $Z$ coordinates,does this mean that the $Z$ coordinates doesn't affect the rotation? And how can I include the $Z$ in the equation?
Your matrix isn't quite correct (Or it is simplified erroneously), the result of multiplying out the rotation matrices in that specific order is actually $$R(\alpha,\beta, \theta)=R_Z(\alpha) \cdot R_Y(\beta) \cdot R_X(\theta) = \left( \begin{array}{ccc} \cos{\alpha \cos{\beta}}&\cos{\alpha}\sin{\beta}\sin{\theta}-\sin{\alpha}\cos{\theta}&\cos{\alpha}\sin{\beta}\cos{\theta}+\sin{\alpha}\sin{\theta} \\ \sin{\alpha \cos{\beta}}&\sin{\alpha}\sin{\beta}\sin{\theta}+\cos{\alpha}\cos{\theta}&\sin{\alpha}\sin{\beta}\cos{\theta}-\cos{\alpha}\sin{\theta} \\ -\sin{\beta}&\cos{\beta}\sin{\theta}&\cos{\beta}\cos{\theta} \end{array} \right) $$ From there can you see that the Z coordinate will show up in the resulting vector/matrix multiplication?