Rotation & translation combined
I'm writing a program in which the user can use the mouse to rotate a shape, and then use the mouse to translate the shape. Or the user can do it in reverse order (translate and then rotate).
The program works fine when the user only performs one of the operations, but the results are not right when the user perform both operations.
I think this may have to do with the idea that when you perform a rotation, you have changed the coordinate system, so the translation now has a different effect.
On the other hand, I would like to discuss the AffineTransform.rotate(theta, anchorx, anchory) method. The docs say that this is equivalent to a sequence of calls where you translate, rotate and then translate back. I have used the method and it works fine. However, when you translate back, don't you end up in a different spot, because the rotation changed your coordinate system?
This question seems to be related to my original idea, that rotation changes the coordinate system, so that translation works differently. Or does it?
If anyone has done work in this area, I'd appreciate your insights.