title: Why isn't OpenGL drawing anything as soon as I use an orthographic projection matrix?
body: <p>When I use a projection matrix as</p>
  <pre><code>glm::mat4 projection(1.0f);
  </code></pre>
  <p>everything works fine and it draws a rectangle, but as soon as I use</p>
  <pre><code>glm::mat4 projection = glm::ortho(0.0f, 800.0f, 600.0f, 0.0f, -1.0f, 1.0f);
  </code></pre>
  <p>I doesn't draw anything anymore.</p>
  <p>Do you have any idea why?</p>
  <p>This is my renderer code:</p>
  <pre><code>void Renderer::renderRect(Shader&amp; shader, glm::vec2 pos, glm::vec2 size, glm::vec3 color, float rotation, float opacity) {
      shader.use();
  
      glm::mat4 model(1.0f);
  
      glm::translate(model, glm::vec3(pos, 0.0f));
  
      glm::scale(model, glm::vec3(size, 1.0f));
  
      glm::mat4 view(1.0f);
  
      glm::mat4 projection = glm::ortho(0.0f, 800.0f, 600.0f, 0.0f, -1.0f, 1.0f);
      //glm::mat4 projection(1.0f);
  
      shader.setMat4(&quot;model&quot;, model);
      shader.setMat4(&quot;view&quot;, view);
      shader.setMat4(&quot;projection&quot;, projection);
  
      shader.setVec4(&quot;color&quot;, glm::vec4(color, opacity));
  
      glBindVertexArray(quadVAO);
      glDrawArrays(GL_TRIANGLES, 0, 6);
      glBindVertexArray(0);
  }
  </code></pre>
  <p>I am not sure where exactely the problem is, but maybe it has to do something with my vertex-shader:</p>
  <pre><code>#version 330 core
  
  layout (location = 0) in vec2 pos;
  
  uniform mat4 model;
  uniform mat4 view;
  uniform mat4 projection;
  
  void main()
  {
      gl_Position = projection * view * model * vec4(pos.xy, 0.0, 1.0);
  }
  </code></pre>
  <p>The renderRect function is called by:</p>
  <pre><code>renderer-&gt;renderRect(shader, glm::vec2(200.0f, 200.0f), glm::vec2(300.0f, 300.0f), glm::vec3(0.0f, 0.0f, 1.0f));
  </code></pre>
  <p>The vertices are:</p>
  <pre><code>float vertices[]{
          0.0f, 1.0f,
          1.0f, 0.0f,
          0.0f, 0.0f,
  
          0.0f, 1.0f, 
          1.0f, 0.0f,
          1.0f, 1.0f
      };
  </code></pre>