I basically have this problem:
Generic Simple 3D Matrix Rotation Issue
and it is driving me mad. I have been on Google for hours but cannot find any posts about
The solution/workaraound is to apply the rotations in the correct order.
If you have rotation matrices A, B and C and want to apply them to matrix M in order A, B, C then the solution is:
First apply A:
A * M
Then B:
B * A * M
And finally C:
C * B * A * M
If you want to apply ABC frequently you can precalculate the combined rotation matrix R:
R = C * B * A
and then you can apply R to M:
R * M