title: How to align a weapon to the camera?
body: <p>I make a FPS game with OpenGL (C++). I want to align a weapon like a gun to the camera, so that she moves and rotates with the camera.</p>
  
  <p>I have accomplished that the weapon moves with the camera by removing the translation part from the view-matrix so that the weapon is always at the same position.</p>
  
  <p>So I have removed the translation part (I work with <a href="https://glm.g-truc.net/0.9.9/api/index.html" rel="nofollow noreferrer">OpenGL Mathematics (GLM)</a>):</p>
  
  <pre><code>view = glm::mat4(glm::mat3(view));
  </code></pre>
  
  <p>The problem is that the weapon does not rotate with the camera. That means when I start the program the gun is aligned correctly but if I turn around the weapon don't turns with me so I can't see her any more.</p>
  
  <p>Can anybody help to accomplish that the weapon is fixed to the camera?</p>