Jump to content
  • Advertisement
Sign in to follow this  
randome1988

Simple 2d graphics/rotation question

This topic is 3827 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Okay, So I have an image, which I can rotate from the top left corner only. The problem is I need to rotate it from the center ... So I have a axis aligned bounding box for the original image, once I rotate I get a brand new axis aligned bounding box that fully encloses the rotated image. At what coordinates do I position the newly rotated images bounding box (top left corner)?

Share this post


Link to post
Share on other sites
Advertisement
The explanation of what you want to do isn't entirely clear but I'll make some quesses.

1. calculate the center of the AABB.
2. translate the vertices of the AABB from the center to the origin.
3. do the rotation
4. calc the new AABB
5. translate the new AABB vertices back to where you want them.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!