Say for example you have a rectangle. The rotational center of the
rectangle is the center in this case at 2,2.
You can use this algo to calculate rotation.
Lets say you rotate the rectangle by 1 radian (~57 degrees).
What is the new coordinates of the top right corner?
Use rotational matrix to calculate the new coordinates of a rotated point.
Put another way, given point x and y, and a center point of cx and cy, calculates the translated x, y points when rotated at a given angle.
For example:
Say for example you have a rectangle. The rotational center of the rectangle is the center in this case at 2,2.
You can use this algo to calculate rotation. Lets say you rotate the rectangle by 1 radian (~57 degrees). What is the new coordinates of the top right corner?
Troubleshoot?
The most common issue is that your rotation value is inverted. Try passing in -rotation and see if that helps.
https://www.youtube.com/watch?v=xsN8cD6oisY&feature=youtu.be https://www.youtube.com/watch?v=a59YQ4qe7mE https://en.wikipedia.org/wiki/Rotation_matrix