title: How to simply Scale an object in openGL?
body: <p>I am trying to learn how to do scaling, rotating, and translating in openGL, but I am not sure exactly how to do so. I tried following an example but it is not working. Below is my sample code, which does not draw the object. Can anyone tell me what I am doing wrong?</p>
  
  <pre><code>#include &lt;stdlib.h&gt;
  #include &lt;GL/glut.h&gt;
  
  GLfloat vertices[][2] = { { -1.0,1.0 },{ -1.0,0.857 },
  { -0.857,0.857 },{ -0.857,1.0 } };
  
  void drawObject() {
  
      glColor3f(0.0f, 0.0f, 0.0f);
      glBegin(GL_POLYGON);
      glVertex2fv(vertices[0]);
      glVertex2fv(vertices[1]);
      glVertex2fv(vertices[2]);
      glVertex2fv(vertices[3]);
      glEnd();
  }
  
  void display(void)
  {
  
      glClearColor(1.0, 1.0, 1.0, 1.0);
      glClear(GL_COLOR_BUFFER_BIT);
      glMatrixMode(GL_MODELVIEW);
      glShadeModel(GL_SMOOTH);
      glColor3f(0.0f, 0.0f, 0.0f);
      glPushMatrix();
      glLoadIdentity();
      glScalef(2.0, 2.0, 0.0);
      drawObject();
      glPopMatrix();
  
      glFlush();
  }
  
  int main(int argc, char** argv)
  {
  
      glutInit(&amp;argc, argv);
      glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);
      glutInitWindowSize(1600, 800);
      glutInitWindowPosition(0, 0);
      glutCreateWindow("Window");
      glutDisplayFunc(display);
      glutMainLoop();
  }
  </code></pre>