从Eigen数学库开始,我遇到了一个非常简单的任务:使用四元数转换一系列向量。似乎我所做的一切都没有operator*
找到,或者将数组与矩阵混合。
Eigen::Quaternionf rot = …;
Eigen::Array3Xf series = …;
// expected this to work as matrix() returns a Transformation:
series.matrix().colwise() *= rot.matrix();
// expected these to work as it's standard notation:
series = rot.matrix() * series.matrix().colwise();
series = rot.toRotationMatrix() * series.matrix().colwise();
// Also tried adding .homogeneous() as one example used it… no dice