Archived

This topic is now archived and is closed to further replies.

2D rotation

This topic is 5649 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

Hi I''m trying to rotate the "Panels" described in this article: http://www.gamedev.net/reference/articles/article1434.asp around their center using matrices but I can only get them to rotate around their upper left corner. I have tried some different methods to rotate them around their center with amusing result, shrinking and growing is quite common... Please help me, I''m sure it''s very easy! // [LANS]Vertex

Share this post


Link to post
Share on other sites
I have not read the article but you basically have two choices. (1) make sure all points are actually centered around the origin at time of creation. Or (b) create a translation matrix to move the points around the center, use your rotation matrix and finally rotate back. All of this can be done by creating on matrix => matDoWork = matTranslation * matRotation * -matTranslation.

Scott

Share this post


Link to post
Share on other sites