4

I'm attempting to rotate a polygon around a fixed axis using the rotate method in Graphics2d. However, after each rotation, the bounding box coordinates of the polygon don't seem to be updating--only the graphical representation. How might I go about fixing this?

1 Answer 1

1

You are using a library method that simply does a graphical transform. It is working the way it was designed. To get the new coordinates, you will have to do the math.

EDIT: Here's a link to another question that has all the math you need.

Drawing a Rotated Rectangle

1
  • That's what I figured. Could you give me some insight regarding the required math? Mar 31, 2013 at 0:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.