计算旋转时相对于其他点的点位置 - C# XNA
我有一个小矩形,中心有一个点。我还有另一个点,就在矩形之外,当矩形垂直放置而不旋转时,距离矩形中心点左侧 10 个像素。当矩形绕其中心旋转时,如何将该外部点保持在相对于矩形的同一位置?
谢谢
I have a small rectangle, with a point at the center. I also have another point, just outside of the rectangle, 10 pixels to the left of the rectangle's center point when the rectangle is sitting vertically, not rotated. How would i go about keeping this outside point in the same place relative to the rectangle when the rectangle is rotated about its center?
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
以下是如何在 XNA 中围绕另一点旋转一个点的示例:
Here is an example of how to rotate one point around another point in XNA:
从矩形的中心点开始“点”,然后将其平移到您想要的位置,然后从那里旋转它。
Start the "point" at the center point of your rectangle, then translate it out to where you want it, and then rotate it from there.