I have an object, which needs to be rotate by two axis (for simplicity, let's call them the X and Y axis, but understand that they can be completely arbitrary).
So, something like this:
Matrix aMat;
aMat.RotateAroundAxis(Vector(1,0,0),45.0f);
aMat.RotateAroundAxis(Vector(0,1,0),25.8f);
When doing this, I get unwanted rotation around the cross product of the two axis I do rotate around (for example, in the example above, I will get some (small) amount of rotation around the z axis, or 0,0,1). It's a very small amount of rotation, but it's enough to be visible, especially if I do a lot of rotations, it seems to accumulate error.
Is there a way I can suppress that?
(Edit: In case there is a better solution to what I'm doing, I have a platform with a weight on it. I want the platform to rotate depending on where the weight is, as if it were balanced on a point. I am doing this by accumulating rotation around two orthogonal axis perpendicular to the platform's up direction, depending on where the "weight" is relative to the center of the platform)