【发布时间】:2015-01-18 22:56:40
【问题描述】:
因此,这是同一问题的链接,但最佳答案并未完全解释:
Rotate Sprite to Mouse Position
这是我坚持的叉积,因为该链接中的公式只能应用于计算之外的数学。
以计算形式计算叉积的实际公式是什么? 如果您可以将其发布为 C++ 代码,那就太好了。
请记住,我正在寻找 2 个 2D 向量之间的叉积,而不是 3D。
【问题讨论】:
-
It's the cross product that I'm stuck with, since the formula in that link can only be applied in mathematics outside of computing.不正确。 @Captain他们说精灵所以我假设它是2D的,他们提供的链接应该足以满足他们的目的。 -
我所看到的无法应用该公式。 sin theta 的第一个实例将为 0,因为我们一开始甚至不知道 theta 是什么。
标签: c++ vector sfml angle cross-product