Well,hi again,i have a question,and this time is about scripting.
To be direct,i'd like to know how i can get width and height of a texture that is rotated on XNA.
Asked
Active
Viewed 216 times
0

Nakano15
- 35
- 9
-
I'd imagine that it's the same width and height of a texture that's not rotated on XNA – Sam I am says Reinstate Monica Jun 24 '13 at 20:20
-
its a trigonometric equation. give me a second to think it up – Daniel Johnson Jun 24 '13 at 20:22
-
1Here you go. http://stackoverflow.com/questions/3231176/how-to-get-size-of-a-rotated-rectangle – Daniel Johnson Jun 24 '13 at 20:25
-
Exactly what i wanted Daniel,thanks. – Nakano15 Jun 24 '13 at 20:26
1 Answers
1
newWidth = textureHeight * Math.Sin(angle) + textureWidth * Math.Cos(angle);
newHeight = textureHeight * Math.Cos(angle) + textureWidth * Math.Sin(angle);

Daniel Johnson
- 691
- 4
- 14