Registered Member
|
Hi,
I'm trying to overwrite the rotational part of a given Affine3d transformation with a custom Matrix3d. Here is an example:
This doesn't compile, and I understand why, but I'm wondering if in the Affine3d transform is possible to reference directly the Matrix3d part (which is the top left corner of the 4x4 matrix) I must use a workaround for this code:
but I think this is very ugly and probably slower... Is there a simpler way to modify directly the rotational part of the affine transformation? Documentation doesn't say much about this argument... Thanks in advance, and again compliments for the spectacular library! |
Registered Member
|
The answer is here under the Geometry Tutorial.
http://eigen.tuxfamily.org/dox/TutorialGeometry.html Just concatenate your affine operations:
|
Registered Member
|
Ok, I know this can be a solution but I didn't want to create a temporary here, only overwrite a piece of a matrix with another given matrix.. |
Registered Member
|
Ok, I found the solution:
This acts only on the linear part of the transformation, that in the case of an Affine transformation is the rotation |
Registered Member
|
Good.
Btw, you can use AngleAxisd instead of the more cumbersome AngleAxis<double>.
|
Registered users: bartoloni, Bing [Bot], Google [Bot], Yahoo [Bot]