Rotating a sprite and getting the new point and rotation

I’m not sure how you’re doing the rotation to start with, but you can create a matrix that is a combination of a translation (of the rotation point to the origin), a rotation (about the new origin), and a translation back to where the point of rotation was. Then you can apply that rotation matrix to the point itself.

The Matrix class has Create methods that you can use for these, I believe, then you multiply them together to create the transformation matrix, which you then multiply the point by. If you’re doing this in 2D, just use the x and y coordinates while setting the Z value to zero, and rotate around the Z-axis for your rotation.

Let me know how it goes :slight_smile:

1 Like