|
-
Find four points of rotated rectangle
Hello. Been searching for this, but the amount of rectangle related questions make it hard to find the answer I'm looking for.
Anyway, I would like to draw 4 lines making a rectangle based on a given width, height, center point, and rotation.
So if I give the program say a 0,0 center point, a width and height of 5, and a rotation of 0, then it would draw four lines like so:
-2,-2 > 2,-2
-2,-2 > -2,2
-2,2 > 2,2
2,-2 > 2,2
(think that's right!)
But yea, hope you get the basic idea. For me it gets real complicated once you add in rotation and such. For my program I will need all 4 points of the rectangle as I have a collision detection that is based colliding with lines...so four lines for each rectangle.
Thanks!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|