title: How to rotate a vector by a given direction
body: <p>I'm creating some random vectors/directions in a loop as a dome shape like this:</p>
  
  <pre><code>void generateDome(glm::vec3 direction)
  {
      for(int i=0;i&lt;1000;++i)
      {
          float xDir = randomByRange(-1.0f, 1.0f);
          float yDir = randomByRange(0.0f, 1.0f);
          float zDir = randomByRange(-1.0f, 1.0f);
  
          auto vec = glm::vec3(xDir, yDir, zDir);
          vec = glm::normalize(vec);
  
          ...
          //some transformation with direction-vector
       }
       ...
  }
  </code></pre>
  
  <p>This creates vectors as a dome-shape in <code>+y</code> direction <code>(0,1,0)</code>:</p>
  
  <p><img src="https://i.stack.imgur.com/ETqHu.png" alt="enter image description here"></p>
  
  <p>Now I want to rotate the <code>vec</code>-Vector by a given direction-Vector like <code>(1,0,0)</code>.
  This should rotate the "dome" to the x-direction like this:</p>
  
  <p><img src="https://i.stack.imgur.com/72wnd.png" alt="enter image description here"></p>
  
  <p>How can I achieve this? (preferably with glm)</p>