This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Generating a 3x3 matrix from a 4x4 Matrix

Tags: None
(comma "," separated)
c0d3rs
Registered Member
Posts
1
Karma
0
Hello,

I was wondering if I am missing a function that allows me to easily generate a 3x3 matrix from an Eigen::Matrix4F?

I'm currently doing it in a bit of an unprofessional manner:

Eigen::Matrix4f FourByFourMatrix;
Eigen::Matrix3f ThreeByThreeMatrix;

ThreeByThreeMatrix << FourByFourMatrix(0,0), FourByFourMatrix(0,1), FourByFourMatrix(0,2) .... FourByFourMatrix(2,2);

Is there a more straighforward approach to doing this?
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
that's easy:
mat.block<3,3>(startRow,startCol), or mat.topLeftCorner<3,3>(), and all the *Corner variants.

see: http://eigen.tuxfamily.org/dox/Tutorial ... tions.html


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]