title: Euler camera, rotation around x axis in camera local system
body: <p>I have camera class that hold her orientation via euler angles and position. Something like that:</p>
  
  <pre><code>float m_x;
  float m_y;
  float m_z;
  
  Vector4 m_pos;
  </code></pre>
  
  <p>And i want to move this camera free over the space.
  When user move mouse up-down camera must rotate around x axis in her own coordinate system. But i want to hold only this three angles and position and nothing more.</p>
  
  <p>So algorithm looks like this:</p>
  
  <ol>
  <li>Find camera local system axis (u, v, n)</li>
  <li>Rotate around u axis on angle alpha</li>
  <li>Find angles around (1, 0, 0), (0, 1, 0), (0, 0, 1) that answer to rotation on angle alpha around u axis</li>
  <li>Add them to m_x, m_y, m_z</li>
  </ol>
  
  <p>Question is: how can i calculate rotation angles in default coordinate system (i mean in (1, 0, 0), (0, 1, 0) and (0, 0, 1)) that answer to rotation angles in local camera coordinate system?</p>
  
  <p><img src="https://i.stack.imgur.com/nEoKE.png" alt="Description"></p>
  
  <p>Or may be better solution exists for this problem?</p>