Excuse me for bothering you again.
But I have another very tricky thing happening.
Well... here is what I have.
In my Rubik's cube I have to rotate all its 6 sides.
And it's working great with front and back sides, up and down sides.
I'm applying rotationY and rotationZ there.
In code it looks like this:
//First I apply position to each cube of the rotating side, so that it has
the correct pivotPoint during the rotation
(currentAnimatedSide[j] as Cube).applyPosition( -currentAnimatedSide[j].x,
-currentAnimatedSide[j].y, -currentAnimatedSide[j].z);
//then I rotate the side
Tweener.addTween(currentAnimatedSide[j], { rotationY:
currentAnimatedSide[j].rotationY + (90 * direction), etc....
//Then after the rotation is complete I applyRotations for each cube:
(currentAnimatedSide[i] as Cube).applyRotations();
Everything is great when I rotate sides on y- and z- axis.
But when I try to rotate the right- and left sides of the cube using
rotationX, it has an unexplainable behavior for me.
The tweening rotation is going fine, but when it's over, and when I
allpyRotations — the whole side suddenly it turns 180 degrees over.
(like if it was applyed rotationX = 180 at this moment)
I can't understand why this is happening, and why it's so different from
rotationZ and Y, which are ok, and everything shoud work the similar here.
Thanks.