java.awt.geometry - Rotating anImage with AffineTransform
I'm rotating an image with AffineTransform the code basicly looks like:
MyImage is about 50px, 100px, and their is a point at 25px, 0px, which rotates with the rest of the image. What I'm asking is: is their anyway to keep track of that point while my image is rotating? It's a spaceship image that has a gun on it and I need to know where the gun is so I can make shooting animation.
AffineTransform aff = new AffineTransform();
g2d.drawImage(MyImage, aff, this);
// get width and height / 2 to rotate from center of image
aff.rotate(.01, MyImage.getWidth() / 2, MyImage.getHeight() / 2);
Let me know if you need more information.
Thank you for reading,
Re: java.awt.geometry - Rotating anImage with AffineTransform
Double post -- closed. Please avoid double posting as was stipulated in the forum rules that you agreed to on joining.