How to convert Eigen::Matrix4f to Eigen::Affine3f
Asked Answered
S

2

10

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

Thanks

Senzer answered 9/12, 2015 at 11:0 Comment(0)
A
15

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

Eigen::Matrix4f a;
Eigen::Affine3f b;
b.matrix() = a;
Ambulate answered 9/12, 2015 at 11:22 Comment(0)
P
9

operator= will do:

Matrix4f M;
Affine3f F;
F = M;
Prevocalic answered 9/12, 2015 at 12:53 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.