Results 1 to 2 of 2
- 02-17-2012, 11:08 PM #1
Member
- Join Date
- Jan 2009
- Posts
- 33
- Rep Power
- 0
java.awt.geometry - Rotating anImage with AffineTransform
Hi,
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.Java Code: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,
Nathan
-
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.
Similar Threads
-
Moving animage; KeyListener simple question
By CuppaCoffee in forum AWT / SwingReplies: 14Last Post: 01-16-2012, 04:09 AM -
Button click for drawing geometry shape
By nnur in forum AWT / SwingReplies: 5Last Post: 05-15-2010, 07:48 PM -
AffineTransform help
By tones in forum New To JavaReplies: 4Last Post: 12-19-2008, 07:24 AM -
Rotating objects in Java Applets
By Unome in forum Java AppletsReplies: 1Last Post: 10-17-2008, 07:35 AM -
AffineTransform demo
By Java Tip in forum java.awtReplies: 0Last Post: 06-22-2008, 10:59 PM


LinkBack URL
About LinkBacks

Bookmarks