I have a game object with a sprite that can rotate. It's a rectangle. I need its bounding box to rotate with it. How do I make sure that they can both rotate, but they're always both at the same angle?
Answer
Each corner should be rotated around the center of the box.
Typically this would be done by translating the box back to the origin, rotating, then translating back to the starting position.
Imagine the points that make up the corners rotating around a circle:
For rotating each point, see this answer.
No comments:
Post a Comment