Sprite Rotation

Started by
9 comments, last by Haytil 12 years, 9 months ago

Draw is not bugged.

I have used many times, with Rotations, Translation and Scaling and it works well.

You have to pay attention to sequence of trasformations... See Mout formula at http://msdn.microsof...6(v=vs.85).aspx

How you can see Traslation is last trasformation ( Mt ).

Mout = (Msc)-1* (Msr)-1* Ms * Msr * Msc * (Mrc)-1* Mr * Mrc * Mt


Remember that Scaling is before Rotation that is before Translation

Regards,
Max.


Did you read all the posts before yours? The issue is not that D3DXMatrixTransformation2D() translates before rotating. The issue is, if you rotate using a matrix generated by D3DXMatrixTransformation2D(), but leave the translation for Draw() (as opposed to also incorporating it in the matrix generated by D3DXMatrixTransformation2D() with your rotation), then Draw() will apply the translation BEFORE the rotation.

I can show you example code if you want, but I think it has now been well established by the previous posts.

The reasons I bumped this 2-year old thread was not to have the exact same conclusion repeated. It was because I have a number of questions I would like to know the answers to, in my previous post.

This topic is closed to new replies.

Advertisement