Re: Graphics transforms




"Daniel Pitts" <googlegroupie@xxxxxxxxxxxxx> wrote in message
news:1174345520.465443.41220@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

The rotation works fine. But I can't figure out the translation to get it
back to 0,0

Any clues folks?


You reverse the translations you've done.
g2d.translate(orig.x, orig.y);
g2d.rotate(rect.getTheta(), centre.x, centre.y);

Yeah I'd figured that.
Solution was to cache the original origin and translate it with the polygon
points but leave it alone when rotating.
--
Mike W


.