title: Drawing tetrahedron in openGL + SDL 2.0
body: <p>So I'm pretty new to openGL programming and am just going over the basics for now. I know I should be using VBOs and stuff but wanted to get a little foundation first. I wont present you with all the code just the stuff that draws and sets the scene.</p>
  
  <p>Heres a little code for setting up my camera:</p>
  
  <pre><code>glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
  
  glMatrixMode(GL_PROJECTION);
  glLoadIdentity();
  gluPerspective(70, width / height, 1, 1000);
  glEnable(GL_DEPTH_TEST);
  
  // Move the camera back to view the scene
  glTranslatef(0.0f, 0.0f, -5.0f);
  </code></pre>
  
  <p>I tried to create it around the origin like so (also I never draw the bottom face) :</p>
  
  <pre><code>void drawtetrahedron(GLfloat angle)
  {
  glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
  glMatrixMode(GL_MODELVIEW);
  glLoadIdentity();
  
  glRotatef(angle, 0.0f, 1.0f, 0.0f);
  
  glBegin(GL_TRIANGLES);
  
  glColor3f(1.0f, 0.0f, 0.0f); //FRONT
  glVertex3f(0.0f, 1.0f, 0.0f);
  glVertex3f(1.0f, -1.0f, 1.0f);
  glVertex3f(-1.0f, -1.0f, 1.0f);
  
  glColor3f(0.0f, 1.0f, 0.0f); //RIGHT
  glVertex3f(0.0f, 1.0f, 0.0f);
  glVertex3f(0.0f, -1.0f, -1.0f);
  glVertex3f(1.0f, -1.0f, 1.0f);
  
  glColor3f(0.0f, 0.0f, 1.0f); //LEFT
  glVertex3f(0.0f, 1.0f, 0.0f);
  glVertex3f(-1.0f, -1.0f, 1.0f);
  glVertex3f(0.0f, -1.0f, -1.0f);
  
  glEnd();
  
  }
  </code></pre>
  
  <p>When my window first comes up the red triangle looks fine, but as I rotate it the shape looks a little distorted. If I rotate all the way around (where I cant see the red face at all) it looks normal... What am I missing here?</p>
  
  <p>Heres where it starts to look weird <img src="https://i.stack.imgur.com/D2RSZ.jpg" alt=""></p>
  
  <p>Also any pointers on openGL stuff I'm doing incorrectly (or in general) are greatly appreciated! :D </p>