How to convert Eigen :: Matrix4f to Eigen :: Affine3f

I want to convert a matrix from Eigen :: Matrix4f to Eigen :: Affine3f Any help?

thanks

+5
source share
2 answers

Eigen::Affine3f is typedef Eigen::Transform<float, 3, Eigen::Affine> . According to the link , the type has a member function MatrixType & matrix () , which gives you the matrix interface.

 Eigen::Matrix4f a; Eigen::Affine3f b; b.matrix() = a; 
+7
source

operator= will do:

 Matrix4f M; Affine3f F; F = M; 
+6
source

Source: https://habr.com/ru/post/1237745/


All Articles