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?

Collin Dutter
  • 47
  • 1
  • 5

1 Answers1

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

Community
  • 1
  • 1
Jeff Wolski
  • 6,332
  • 6
  • 37
  • 69