title: How to rotate a computer drawing in 90 degrees
body: <p>I have created a bunny and a duck image in my blank window. My plan was to display it twice: once by itself and another image like it rotated at a 90 degrees. I've tried creating the image a second time and turning the image by changing values, but was difficult and couldn't work at all. Which axes needs to be used to rotate an image in a plane and the right way to accomplish it.</p>
  
  <pre><code>void myInit(void){
          glClearColor(1.0, 1.0, 1.0, 0);  // the background is white
          glColor3f(0.0f, 0.0f, 0.0f);  // set drawing color
          gluOrtho2D(0.0, (GLdouble) screenWidth, 0.0, (GLdouble) screenHeight);
      }
  
  void drawBunny(){
      glClear(GL_COLOR_BUFFER_BIT);
      // draw the outline of box (bunny)
      glLineWidth(2);
      glBegin(GL_LINE_LOOP);
          glVertex2i(50,50);
          glVertex2i(150,50);
          glVertex2i(150,100);
          glVertex2i(50,100);
  
      glEnd();
  
      //draw bunny tail
      glLineWidth(1);
      glBegin(GL_LINE_STRIP);
       glVertex2i(50,50);
       glVertex2i(50,35);//2nd wider top/bottom
       glVertex2i(70,35);//1st- shrink tail left/right
      glVertex2i(70,50);//1st- shrink tail left/right
      glEnd();
  
      // draw first ear
      glBegin(GL_LINE_LOOP);
          glVertex2i(175,85);
          glVertex2i(175,100);
          glVertex2i(150,100);
          glVertex2i(150,85);
      glEnd();
  
      //draw second ear
      glBegin(GL_LINE_LOOP);
          glVertex2i(175,70);
          glVertex2i(175,100);
          glVertex2i(150,100);
          glVertex2i(150,70);
      glEnd();
  
      // draw the head
      glBegin(GL_LINE_LOOP);
          glVertex2i(150,100);
          glVertex2i(150,110);
          glVertex2i(125,110);
          glVertex2i(125,100);
      glEnd();
  
      // draw first feet
      glBegin(GL_LINE_LOOP);
          glVertex2i(110,60);
          glVertex2i(110,75);
          glVertex2i(30,75); //decrease value increase feet
          glVertex2i(30,60);
      glEnd();
  
      //draw second feet
      glBegin(GL_LINE_LOOP);
          glVertex2i(50,100);
          glVertex2i(50,85);
          glVertex2i(30,85); //decrease value increase feet
          glVertex2i(30,100);
      glEnd();
  
       //* draw eyes
      glBegin(GL_LINE_LOOP);
          glVertex2i(140,100);
          glVertex2i(140,105);
          glVertex2i(135,105);
          glVertex2i(135,100);
      glEnd();
      glFlush();
  }
  
  int main (int argc, char** argv){
      glutInit(&amp;argc, argv);  // initialize the toolkit
      glutInitDisplayMode(GLUT_SINGLE | GLUT_RGB);  // set display mode
      glutInitWindowPosition(100,150);  // set window position
      glutInitWindowSize(screenWidth,screenHeight); // set window size
      glutCreateWindow("House");  // create &amp; open window
      glutDisplayFunc(drawBunny);  // register redraw function
      myInit();
      glutMainLoop();  // loop forever
  }
  </code></pre>