将旋转应用于特征::仿射3f
Apply rotation to Eigen::Affine3f
我正在使用Eigen::Affine3f
来表示相机矩阵。(我已经弄清楚了如何从初始"lookAt"和"up"向量设置视图矩阵/Affine3f
)
现在,我想支持更改相机的方向。简单的问题:将旋转应用于此Affine3f
的最佳方法是什么,即俯仰,偏航,滚动?
使用内置功能非常简单。您可以使用 AxisAngle
对象将现有Affine3f
相乘。请注意,轴需要归一化:
Vector3f rotationAxis;
rotationAxis.setRandom(); // I don't really care, you determine the axis
rotationAxis.normalize(); // This is important, don't forget it
Affine3f randomAffine3f, rotatedAffine;
// Whatever was left in memory in my case,
// whatever your transformation is in yours
std::cout << randomAffine3f.matrix() << std::endl;
// We'll now apply a rotation of 0.256*M_PI around the rotationAxis
rotatedAffine = (AngleAxisf(0.256*M_PI, rotationAxis) * randomAffine3f);
std::cout << rotatedAffine.matrix() << std::endl; // Ta dum!!
相关文章:
- 仿射密码解密,输出大小写不同
- 在特征中显示仿射变换
- 简单仿射密码加密解密
- 可视化:如何使用R&T向量仿射变换Point3D?
- OpenCV中的Hessian-仿射检测器
- C++ 中的仿射密码加密
- 仿射旋转矩阵
- 如何为仿射变换创建形状的OpenCV垫[3,2]
- 如何获得具有3x3矩阵的仿射变换
- 椭圆形斑块之间的仿射变换
- 将旋转应用于特征::仿射3f
- 如何将特征::Matrix4f转换为特征::仿射3f
- 我的仿射变换发生了一些奇怪的事情
- 结合两个仿射变换矩阵在OpenCV
- 如何连接仿射变换函数与事件从程序
- 仿射插值变换
- 在示例代码中运行仿射转换时出错。
- 与旋转相对于任意点的OpenCV warpa仿射
- 使用dlib在图像上应用仿射变换
- 如何用平移、旋转和缩放来反转一个仿射变换