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

I have two questions.

  • Will the hard conversion presented in Eigen :: Affine3f and Eigen :: Matrix4f be the same?

  • How can we convert from Eigen :: Affine3f to Eigen :: Matrix4f and vice versa?

Thank you for your help!

+4
source share
1 answer

Yes, MatrixXf is stored inside Affine3f, so you can do:

Eigen::Affine3f A;
Eigen::Matrix4f M;
M = A.matrix();
A = M;               // assume that M.row(3) == [0 0 0 1]
+6
source

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


All Articles