Rotations in IMVU or Cal3D
A few simple rotations:
No rotation at all
Rotation about the X axis
Rotation about the Y axis
Rotation about the Z axis
This is the difficult one: rotations are represented using a specialised form of complex number known as a quaternion. My best guess is that the number parts are meant to be read from right to left.
If we call two rotations P (P3,P2,P1,P0) and Q (Q3,Q2,Q1,Q0) and the combination R (R3,R2,R1,R0) then to determine R we need
Reversing or undoing a rotation
You can reverse the effect of a rotation by negating Q0 or negating Q1,Q2,Q3, either one works. Multiplying the rotation by its reverse or "conjugate" yields "0 0 0 1" or "0 0 0 -1". Note this is not the same as rotating the same joint in the other direction.
Normalising or cleaning up
The values should be "normalised", that is to say they should satisfy Q02+Q12+Q22+Q32=1
If you start with normalised values you should finish with normalised values, but if you perform a lot of operations they may "drift" due to rounding.