title: Why do I have to calculate the transpose of the inverse of the model matrix in order to calculate the normal for the reflection texture?
body: <p>I am following <a href="http://learnopengl.com/#!Advanced-OpenGL/Cubemaps" rel="nofollow">this</a> tutorial to create a skybox/cubemap with environmental mapping. I am having some trouble understanding a calculation in the vertex shader:</p>
  
  <pre><code>#version 330 core
  layout (location = 0) in vec3 position;
  layout (location = 1) in vec3 normal;
  
  out vec3 Normal;
  out vec3 Position;
  
  uniform mat4 model;
  uniform mat4 view;
  uniform mat4 projection;
  
  void main()
  {
      gl_Position = projection * view * model * vec4(position, 1.0f);
      Normal = mat3(transpose(inverse(model))) * normal;
      Position = vec3(model * vec4(position, 1.0f));
  }
  </code></pre>
  
  <p>Here, the author is calculating the Normal before passing it to the fragment shader to calculate the reflection texture:</p>
  
  <pre><code>Normal = mat3(transpose(inverse(model))) * normal;
  </code></pre>
  
  <p>My question is, what exactly does this calculation do? Why do you have to calculate the transpose of the inverse of the model matrix before multiplying it with the normal?</p>