Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我可以使用 Eigen 库来获取将向量 A 旋转到向量 B 的旋转矩阵吗?我一直在寻找一段时间,但找不到相关的api。
您首先必须构造一个四元数,然后将其转换为矩阵,例如:
#include <Eigen/Geometry> using namespace Eigen; int main() { Vector3f A, B; Matrix3f R; R = Quaternionf().setFromTwoVectors(A,B); }