The forums have permanently moved to forum.kirupa.com. This forum will be kept around in read-only mode for archival purposes. To learn how to continue using your existing account on the new forums, check out this thread.


Results 1 to 6 of 6

Thread: Corner Coordinates of Rotated Rectangle

  1. #1

    Corner Coordinates of Rotated Rectangle

    I bet there's an easy answer to this one:

    How do I get the x and y position of a rotated rectangle's (or an MC that contains a rectangular shape) top-right, bottom-right and bottom-left corners (not its bounding rectangle)?

    Thnx!

    E

  2. #2
    I haven't used it, but you might look into localToGlobal. That might get you what you need pretty easily.

    That or trigonometry.

  3. #3
    you can use the matrix you rotated the object with (or create one).

    you will need the original coordinates for each of the four points:
    click

  4. #4
    I think you will indeed have to get busy with your maths mate!

    Will you know the radius of your rounded corners? If so, it may not be so difficult to find the x / y of given points along the curve, if thats what you meant.

  5. #5
    I haven't used localToGlobal, but it seems like it would work. Is there a reason the two of you didn't agree with my suggestion?

  6. #6
    Quote Originally Posted by cesig View Post
    I haven't used localToGlobal, but it seems like it would work. Is there a reason the two of you didn't agree with my suggestion?
    Only because i'm an idiot and didn't read the post properly! lol! You know how it is, sneaking around forums whilst the boss isnt looking your way! Just skim read it. I thought he was on about a rounded rectangle (finding the points along the curved corner)

    Your right, localToGlobal will nail it! sorry Cesig

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012