How to convert from Eigen::Affine3f to Eigen::Matrix4f
Asked Answered
T

1

5

I have two questions.

  1. Does the rigid transformation represented in Eigen::Affine3f and Eigen::Matrix4f will be the same ?

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

Thanks for your help!

Tabular answered 24/4, 2014 at 7:25 Comment(0)
L
7

Yes, internally an Affine3f stores a MatrixXf, so you can do:

Eigen::Affine3f A;
Eigen::Matrix4f M;
M = A.matrix();
A = M;               // assume that M.row(3) == [0 0 0 1]
Longhorn answered 24/4, 2014 at 8:55 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.