Registered Member
|
Hi,
I have the following code snippet:
As can be seen, I want to construct a quaternion from a Eigen::Matrix3f (which should work looking at the Eigen documentation). I get the following output:
The matrix of eigenvectors looks like a valid rotation matrix around a single axis to me, but for the quaternion I get a rotation around multiple axes. I fail to see the mistake I'm making. If I flip around the columns of the matrix of eigenvalues like so:
I get the following non-normalized quaternion (which looks like a wrong constructor is used, copying elements of the input matrix):
I'm using Eigen installed from the package manager on a 64bit Ubuntu Natty system. |
Registered Member
|
I'm not sure what you mean with single axis / multiple axes. I suppose you are refering to the coordinate axes (x-axis, y-axis and z-axis). However, the matrix is not a rotation around one of the coordinate axes. The matrix for a rotation around the coordinate axes are as given in Wikipedia as the 'basic rotations', see http://en.wikipedia.org/wiki/Rotation_matrix#Basic_rotations. Your matrix is not in one of these forms (the 1 should be on the main diagonal).
The matrix eigVecFlipped has determinant -1, so it is not a rotation matrix. I guess that's why you get an unexpected result. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]