title: How to rotate rectangle around its center in LWJGL?
body: <p>As the question states, I would like to know how to rotate a drawn rectangle around its center.</p>
  
  <p>I am currently using the following code:</p>
  
  <pre><code>GL11.glPushMatrix();
  
      GL11.glColor3f(0.3f, 0.3f, 0.3f);
  
      this.setAngle(this.getAngle()+1);
  
      GL11.glRotated(270-this.getAngle(),0,0,1);
      GL11.glTranslated(-0.5,-0.5,1);
  
      GL11.glRectd(this.getX(),this.getY(), this.getX()+this.getWidth(), this.getY()+this.getHeight());
  
  GL11.glPopMatrix();
  </code></pre>
  
  <p>Now, the rotation occurs in a 2D space, but I can't seem to centralize the rectangle's rotation. Instead, the rectangle keeps rotating around the global point 0,0.</p>
  
  <p>I think that I may have the rotation and translation setup incorrectly or in the incorrect order.</p>
  
  <p>I would like not what is stopping this code from producing the desired output.
  Any suggestions and answers would be greatly appreciated.</p>
  
  <p>Thanks.</p>