Results 1 to 2 of 2
  1. #1
    natdizzle's Avatar
    natdizzle is offline Nathan Nelson
    Join Date
    Jan 2009
    Rep Power

    Post java.awt.geometry - Rotating anImage with AffineTransform


    I'm rotating an image with AffineTransform the code basicly looks like:

    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);
    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.

    Let me know if you need more information.

    Thank you for reading,

  2. #2
    Fubarable's Avatar
    Fubarable is offline Moderator
    Join Date
    Jun 2008
    Blog Entries
    Rep Power

    Default 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

  1. Moving animage; KeyListener simple question
    By CuppaCoffee in forum AWT / Swing
    Replies: 14
    Last Post: 01-16-2012, 04:09 AM
  2. Button click for drawing geometry shape
    By nnur in forum AWT / Swing
    Replies: 5
    Last Post: 05-15-2010, 07:48 PM
  3. AffineTransform help
    By tones in forum New To Java
    Replies: 4
    Last Post: 12-19-2008, 07:24 AM
  4. Rotating objects in Java Applets
    By Unome in forum Java Applets
    Replies: 1
    Last Post: 10-17-2008, 07:35 AM
  5. AffineTransform demo
    By Java Tip in forum java.awt
    Replies: 0
    Last Post: 06-22-2008, 10:59 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts