Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Ok, I found the solution and I post it here for reference. I hope it can be useful to someone else as well.</p> <p>Actually ggael's answer triggered the right solution, so many thanks to him and +1 for him.</p> <hr> <pre><code>#include &lt;Eigen/Geometry&gt; typedef Eigen::Affine3d Transformation; typedef Eigen::Vector3d Point; typedef Eigen::Vector3d Vector; typedef Eigen::Translation&lt;double,3&gt; Translation; Transformation findTransformBetween2CS(Point fr0,Point fr1,Point fr2,Point to0,Point to1,Point to2) { Transformation T, T2, T3 = Transformation::Identity(); Vector3d x1,y1,z1, x2,y2,z2; // Axes of the coordinate system "fr" x1 = (fr1 - fr0).normalized(); // the versor (unitary vector) of the (fr1-fr0) axis vector y1 = (fr2 - fr0).normalized(); // Axes of the coordinate system "to" x2 = (to1 - to0).normalized(); y2 = (to2 - to0).normalized(); // transform from CS1 to CS2 // Note: if fr0==(0,0,0) --&gt; CS1==CS2 --&gt; T2=Identity T2.linear() &lt;&lt; x1, y1, x1.cross(y1); // transform from CS1 to CS3 T3.linear() &lt;&lt; x2, y2, x2.cross(y2); // T = transform to CS2 to CS3 // Note: if CS1==CS2 --&gt; T = T3 T.linear() = T3.linear() * T2.linear().inverse(); T.translation() = t0; return T; } </code></pre> <hr> <p>Inspiration also came from this post:</p> <p><a href="https://gamedev.stackexchange.com/questions/26084/transform-between-two-3d-cartesian-coordinate-systems">https://gamedev.stackexchange.com/questions/26084/transform-between-two-3d-cartesian-coordinate-systems</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload