Rotate object on absolute axes, the order matters

Hey there!
I need to rotate a cube on fixed axes (x and z). The order of the rotations does matter for me. So rotations: x90,x90,z90,x90 != x270, z90. Should i use quaternions for this?

What’s wrong with Euler angles for this task? You sure don’t need smooth interpolation for such a simple animation.

if i rotate on one axis the other axes turn too, so after the first rotation i have to determine the new axes.

Correct. Sounds like what you want are object space rotations.
Check out the code below. It does both object and screen space rotations.

http://www.mfwweb.com/OpenGL/Special_Rotations/