title: interpolate two matrices with Eigen3
body: <p>I have two transformation matrices and I want to interpolate between them for an animation.
  As mentioned <a href="https://stackoverflow.com/questions/3093455/3d-geometry-how-to-interpolate-a-matrix">here</a> it is not possible to simply interpolate the single values. Is there an easy way to accomplish this? (I use Eigen3)</p>
  
  <p>My Idea:</p>
  
  <pre><code>Eigen::Matrix4f m1; //Transformation Matrix 1
  Eigen::Matrix4f m2; //Transformation Matrix 2
  Eigen::Quaternion&lt;float&gt; quat1(m1.block&lt;3,3&gt;(0,0)); //This extracts rotation matrix
  Eigen::Quaternion&lt;float&gt; quat2(m2.block&lt;3,3&gt;(0,0));
  quat1.slerp(t,quat2); //This interpolates
  
  //Now i need a 4x4 Matrix again
  Eigen::Matrix3f rot=quat1.toRotationMatrix();
  Eigen::Matrix4f newmatrix;
  newmatrix.block&lt;3,3&gt;(0,0)=rot;
  </code></pre>
  
  <p>Is there something wrong with my code and is there an easy way to accomplish (rotation) matrix interpolation?</p>