title: Why does my triangle does not shown correctly?
body: <p><strong>Good evening,</strong></p>
  
  <p>I've followed this tutorial <a href="http://learnopengl.com/#!In-Practice/2D-Game/Rendering-Sprites" rel="nofollow noreferrer">learnopengl.com</a> with python instead of c++. Everything seems to work but my triangle doesn't show up correctly.</p>
  
  <p>I checked every single line if I missed something more than twice but I cant find the issue.</p>
  
  <p><a href="http://pastie.org/private/d2qfz1appqas9l5v7x2rsw" rel="nofollow noreferrer">SpriteRenderer</a> | <a href="http://pastie.org/private/ewruzvzmdqy12eqihephza" rel="nofollow noreferrer">Shader</a> | <a href="http://pastie.org/private/6gbbvujrhaebr0snxg4cw" rel="nofollow noreferrer">ResourceManager</a> | <a href="http://pastie.org/private/hhv8x258lohwtvxdjhhrdg" rel="nofollow noreferrer">Program</a> | <a href="http://pastie.org/private/hg6b0sxtvfl4rkoballtoq" rel="nofollow noreferrer">Game</a> (change the path inside Game to the shaders)</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Okay well now I can see my triangle, when I change </p>
  
  <ul>
  <li><strong>rotation to 0</strong></li>
  <li><strong>position</strong> <strong><em>AND</em></strong> <strong>size</strong> to the same size like <strong>200, 200</strong></li>
  <li>and instead of <strong>transform.ortho(0., SCREEN_WIDTH, SCREEN_HEIGHT, 0, -1, 1)</strong> to <strong><em>transform.ortho(0., SCREEN_WIDTH, 0, SCREEN_HEIGHT, -1, 1)</em></strong></li>
  <li>using the <strong>same</strong> <strong>model matrix (SpriteRenderer) down below</strong></li>
  </ul>
  
  <p><a href="https://i.stack.imgur.com/uwA0X.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/uwA0X.png" alt="enter image description here"></a></p>
  
  <p><strong>Important Snippets</strong></p>
  
  <p>orth matrix (Game)</p>
  
  <pre><code>array([[ 0.0025    ,  0.        ,  0.        , -1.        ],
         [ 0.        , -0.00333333,  0.        ,  1.        ],
         [ 0.        ,  0.        , -1.        , -0.        ],
         [ 0.        ,  0.        ,  0.        ,  1.        ]], dtype=float32)
  </code></pre>
  
  <p>model matrix (SpriteRenderer)</p>
  
  <pre><code>T = glm.translation_matrix([position[0],position[1],0])
  # bewegt den den pivot zum mittelpunkt
  Tcenter = glm.translation_matrix([0.5 * size[0], 0.5 * size[1], 0])
  R = glm.rotation_matrix(rotate, [0,0,1])
  # bewegt den pivot wieder zurueck
  Tback = glm.translation_matrix([-0.5 * size[0], -0.5 * size[1], 0])
  # scaliert den koerper
  S = glm.compose_matrix(scale = [size[0],size[1],1])
  
  model = glm.concatenate_matrices(T, Tcenter, R, Tback, S)
  
  self._shader.setMatrix4("model", model)
  self._shader.setVector("customColor", color)
  
  gl.glBindVertexArray(self._vao);
  gl.glDrawArrays(gl.GL_TRIANGLES, 0, 3)
  gl.glBindVertexArray(0)
  </code></pre>
  
  <p>VAO VBO (SpriteRenderer)</p>
  
  <pre><code>vertexBufferData = np.array(([-1, -1],
                               [ 1, -1],
                               [ 0,  1]),
                               dtype='float32')
  
  # ----- VBO ------
  
  # Request a buffer slot from GPU
  VBO = gl.glGenBuffers(1)
  # Make this buffer the default one
  gl.glBindBuffer(gl.GL_ARRAY_BUFFER, VBO)
  # Upload data
  gl.glBufferData(gl.GL_ARRAY_BUFFER, vertexBufferData.nbytes ,vertexBufferData, gl.GL_STATIC_DRAW)
  
  # ------ VAO ------
  
  # Aktivieren des Vertex Array mit der ID
  gl.glBindVertexArray(self._vao)
  gl.glEnableVertexAttribArray(0)
  gl.glVertexAttribPointer(0, 2, gl.GL_FLOAT, False, 0, c_void_p(0))
  #len(vertexBufferData), gl.GL_FLOAT, gl.GL_FALSE,4*4, c_void_p(0))
  
  # unbind das aktuelle vertex objekt VAO und VBO
  #gl.glDisableVertexAttribArray(0)
  gl.glBindBuffer(gl.GL_ARRAY_BUFFER, 0)
  gl.glBindVertexArray(0)
  </code></pre>
  
  <p><strong>fragmentshader</strong>:</p>
  
  <pre><code>#version 330 core
  out vec4 color;
  
  uniform vec3 customColor;
  
  void main()
  {
      color = vec4(customColor, 1.0);
  }
  </code></pre>
  
  <p><strong>vertexshader</strong></p>
  
  <pre><code>#version 330 core
  layout(location = 0) in vec2 position;
  
  uniform mat4 model;
  uniform mat4 projection;
  
  void main()
  {
      gl_Position = projection * model * vec4(position.xy, 0.0, 1.0);
  }
  </code></pre>