title: Trouble with Parent/Child in OpenGL
body: <p>I am currently using C code in Codeblocks for OpenGL and I am having trouble making objects operating independently. In my case I have separate fingers and each one seems to be reliant on the previous finger coding and I cannot seem to figure out why exactly. I think I have gone wrong with my Push and Pop but not sure where. Any help would be appreciated.</p>
  <p>This is the important part of the code</p>
  <pre><code>glClear (GL_COLOR_BUFFER_BIT);
  glPushMatrix();
  
  glTranslatef(-1.0, 0.0, 0.0);
  glRotatef((GLfloat) shoulder, 0.0, 0.0, 1.0);
  glTranslatef(1.0, 0.0, 0.0);
  glPushMatrix();
  glScalef(2.0, 0.4, 1.0);
  glutWireCube(1.0);
  glPopMatrix();
  
  glTranslatef(1.0, 0.0, 0.0);
  glRotatef((GLfloat) elbow, 1.0, 0.0, 1.0);
  glTranslatef(1.0, 0.0, 0.0);
  glPushMatrix();
  glScalef(2.0, 0.4, 1.0);
  glutWireCube(1.0);
  glPopMatrix();
  
  glTranslatef (1.0, 0.0, 0.0);
  glRotatef ((GLfloat) finger, 0.0, 0.0, 1.0);
  glTranslatef (0.25, 0.0, 0.0);
  glPushMatrix();
  glScalef(0.5, 0.1, 0.1);
  glutSolidCube(1.0);
  glPopMatrix();
  
  glTranslatef (0.25, 0.0, 0.0);
  glRotatef ((GLfloat) fingerjoint, 0.0, 0.0, 1.0);
  glTranslatef (0.25, 0.0, 0.0);
  glPushMatrix();
  glScalef(0.5, 0.1, 0.1);
  glutSolidCube(1.0);
  glPopMatrix();
  
  //need to make finger2 not reliant on fingerjoint
  glTranslatef (-0.75, 0.0, 0.0);
  glRotatef ((GLfloat) finger2, 0.0, 0.0, 1.0);
  glTranslatef (0.25, 0.0, 0.25);
  glPushMatrix();
  glScalef(0.5, 0.1, 0.1);
  glutWireCube(1.0);
  glPopMatrix();
  
  glTranslatef (0.25, 0.0, 0.0);
  glRotatef ((GLfloat) finger2joint, 0.0, 0.0, 1.0);
  glTranslatef (0.25, 0.0, 0.0);
  glPushMatrix();
  glScalef(0.5, 0.1, 0.1);
  glutWireCube(1.0);
  glPopMatrix();
  
  //need to make finger3 not reliant on previous fingerjoints
  glTranslatef (-0.75, 0.0, 0.0);
  glRotatef ((GLfloat) finger3, 0.0, 0.0, 1.0);
  glTranslatef (0.25, 0.0, -0.5);
  glPushMatrix();
  glScalef(0.5, 0.1, 0.1);
  glutWireCube(1.0);
  glPopMatrix();
  
  glTranslatef (0.25, 0.0, 0.0);
  glRotatef ((GLfloat) finger3joint, 0.0, 0.0, 1.0);
  glTranslatef (0.25, 0.0, 0.0);
  glPushMatrix();
  glScalef(0.5, 0.1, 0.1);
  glutWireCube(1.0);
  glPopMatrix();
  
  glPopMatrix();
  glutSwapBuffers();
  </code></pre>