title: solvePnP with Unity3D
body: <p>I have a real/physical stick with an IR camera attached to it and some IR LED that forms a pattern that I'm using in order to make a virtual stick move in the same way as the physical one.</p>
  
  <p>For that, I'm using OpenCV in Python and send a rotation and translation vector calculated by solvePnP to Unity.</p>
  
  <p>I'm struggling to understand how I can use the results given by the solvePnP function into my 3D world.</p>
  
  <p>So far what I did is: using the solvePnP function to get the rotation and translation vectors. And then use this rotation vector to move my stick in the 3d World</p>
  
  <pre><code>transform.rotation = Quaternion.Euler(new Vector3(x, z, y));
  </code></pre>
  
  <p>It seems to work okay when my stick is positioned at a certain angle and if I move slowly...but most of the time it moves everywhere.</p>
  
  <p>By looking for answers online, most of people are doing several more steps after solvePnP - from what I understand:</p>
  
  <ol>
  <li><p>Using Rodrigues to convert the rotation vector to a rotation matrix</p></li>
  <li><p>Copy the rotation <strong>matrix</strong> and translation <strong>vector</strong> into a extrinsic matrix</p></li>
  <li>Inverse the extrinsic matrix</li>
  </ol>
  
  <p>I understand that these steps are necessary if I was working with matrix like in OpenGL - but what about Unity3D? Are these extra steps necessary? Or can I directly use the vectors given by the solvePnP function (which I doubt as the results I'm having so far aren't good).</p>