Created
May 15, 2013 12:40
-
-
Save anonymous/5583715 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// The translation vector is the first 3 elements 4-th column of the inverse of K | |
Vector3d t = K.inverse()*A.col(3).head<3>(); | |
// Affine3d is a 4x4 matrix that allows simple manipulation of affine transformations | |
Affine3d computeOpenGLModelViewMatrix(const Eigen::Matrix3d &Rot, const Vector3d &trans) | |
{ | |
Affine3d MV = Affine3d::Identity(); | |
MV.linear().matrix() << Rot; // set the upper-left 3x3 rotation part | |
MV.translation() << trans; // set the 4-th column with the translation | |
return MV; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment