What is the simplest way to convert an affine transformation to an isometric transformation (i.e. consisting of only a rotation and translation) using the Eigen library?
Both transformations are 3D. The affine matrix has a general 3x3 matrix (i.e. rotation, scaling and shear) for the top left quadrant, whereas the isometry has a 3x3 rotation matrix for the same quadrant, therefore a projection is required.
Eigen::AffineCompact3f a;
Eigen::Isometry3f b(a);
gives the compile error:
error C2338: YOU_PERFORMED_AN_INVALID_TRANSFORMATION_CONVERSION
whilst
Eigen::AffineCompact3f a;
Eigen::Isometry3f b(a.rotation(), a.translation());
gives
(line 2) error C2661: 'Eigen::Transform<_Scalar,_Dim,_Mode>::Transform' : no overloaded function takes 2 arguments
and
Eigen::AffineCompact3f a;
Eigen::Isometry3f b;
b.translation() = a.translation();
b.rotation() = a.rotation();
gives
(line 4) error C2678: binary '=' : no operator found which takes a left-hand operand of type 'const Eigen::Matrix<_Scalar,_Rows,_Cols>' (or there is no acceptable conversion)
Given the rotation() and translation() functions, the question can be rephrased as "How do I best set the rotation and translation components of an isometric transform?"