Timeline for Bounding box of a rotated rectangle (2d)
Current License: CC BY-SA 3.0
4 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Dec 7, 2011 at 17:53 | comment | added | Chris Evans | I see what you mean now, I got that wrong. x1 = ((self.getCentralX()-width/2) * Math.cos(rotation)) - ((self.getCentralY()-height/2) * Math.sin(rotation)); y1 = ((self.getCentralX()-width/2) * Math.sin(rotation)) + ((self.getCentralY()-height/2) * Math.cos(rotation)); x2 = ((self.getCentralX()+width/2) * Math.cos(rotation)) - ((self.getCentralY()+height/2) * Math.sin(rotation)); y2 = ((self.getCentralX()+width/2) * Math.sin(rotation)) + ((self.getCentralY()+height/2) * Math.cos(rotation)); I've tried that but it also doesn't work. The line disappears as the object rotates. | |
Dec 7, 2011 at 17:52 | history | edited | sam hocevar | CC BY-SA 3.0 |
deleted 467 characters in body
|
Dec 7, 2011 at 17:48 | comment | added | Chris Evans | I apologise but I didn't mean to have the width/2 in there at all - that was from some playing about trying to get it to work. | |
Dec 7, 2011 at 17:41 | history | answered | sam hocevar | CC BY-SA 3.0 |