Reputation: 10996
I have a raw floating array of 12 elements which contain an affine transformation matrix and I would like to map it to an Affine3f object.
The input floating point array actually stores the parameter in a row major sequence, while the Affine3f stores it in a column major format, if I am correct.
Is there nice Eigen recommended way to map such an array to the Affine3f object?
Upvotes: 0
Views: 690
Reputation: 29205
You can either cast it as a Transform<float,3,AffineCompact,RowMajor>
which is ugly, or copy the coefficients using a Map
:
AffineCompact3f A;
A = Map<Matrix<float,3,4,RowMajor> >(data);
Upvotes: 1