title: 2D opengl rotation causes sprite distortion
body: <p>I am quite new to using OpenGL ES 2.0. Also im using an iPhone and the GLM maths library. As I reference I have been using this tutorial a lot: <a href="http://tomdalling.com/blog/modern-opengl/03-matrices-depth-buffering-animation/" rel="nofollow">http://tomdalling.com/blog/modern-opengl/03-matrices-depth-buffering-animation/</a> But I have found it difficult to find a 2D OpenGL tutorial.</p>
  
  <p>I am trying to rotate a 2D sprite but the image is being distorted.
  For example at a rotation angle of 0 degrees: <a href="http://i.imgur.com/yBTN2ST.png" rel="nofollow">http://i.imgur.com/yBTN2ST.png</a> and at a rotation angle of 45 degrees: <a href="http://i.imgur.com/cY5IJcg.png" rel="nofollow">http://i.imgur.com/cY5IJcg.png</a></p>
  
  <p><strong>In my sprite class</strong></p>
  
  <pre><code>glm::mat4 projection = glm::ortho(0.0f, 480.0f, 0.0f, 320.0f);
  glUniformMatrix4fv(projectionUniform, 1, GL_FALSE, glm::value_ptr(projection));
  
  glm::mat4 newModel = glm::rotate(glm::mat4(), 0.0f, glm::vec3(0, 0, 1));
  glUniformMatrix4fv(modelUniform, 1, GL_FALSE, value_ptr(newModel));
  
  glDrawArrays(GL_TRIANGLE_STRIP, 0, 4);
  </code></pre>
  
  <p><br>
  <strong>In my vertex shader</strong></p>
  
  <pre><code>vec4 newPosition = vec4(position + offset, 0.0, 1.0);
  gl_Position = model * projection * newPosition;
  </code></pre>
  
  <p>I think that part of the problem is that the image is being rotated without considering the aspect ratio im not really sure how to fix this.</p>
  
  <p>Thanks</p>