math - Working out point location relative to other point when rotated - C# XNA -
i have small rectangle, point @ center. have point, outside of rectangle, 10 pixels left of rectangle's center point when rectangle sitting vertically, not rotated. how go keeping outside point in same place relative rectangle when rectangle rotated center?
thanks
here example of how rotate 1 point around point in xna:
public vector2 rotatepoint(vector2 pointtorotate, vector2 centerofrotation, float angleofrotation) { matrix rotationmatrix = matrix.createrotationz(angleofrotation); return vector2.transform(pointtorotate - centerofrotation, rotationmatrix); }
Comments
Post a Comment