title: OpenGL independent translation after doing translation+rotation?
body: <p>I want to acheive translations/rotations as shown in following video -</p>
  
  <p><a href="http://www.youtube.com/watch?v=92h0xuV4Yrg" rel="nofollow">http://www.youtube.com/watch?v=92h0xuV4Yrg</a></p>
  
  <p>I know for independant translation and rotation, typical method is - first rotate the object and then translate.</p>
  
  <p>As shown  here:</p>
  
  <pre><code>PushMatrix();
  LoadIdentity(); 
  Translate(posx,posy,posz);     // Second, move the object to its final destination
  Rotate();        // First, apply rotations (which rotate around object-origin
  Draw();         
  PopMatrix();
  </code></pre>
  
  <p>But my requirment is to rotate the object around world-coordinate and move it using mouse.</p>
  
  <p>As seen in the video, the rotation is done around the world-origin not around object-origin.That means the logic should be opposite to above (first translate and then do the rotation)</p>
  
  <pre><code>PushMatrix();
  LoadIdentity(); 
  Rotate();        // Second, apply rotations (which rotate around world-origin)
  Translate(posx,posy,posz);     // First, move the object to its final destination
  Draw();         
  PopMatrix();
  </code></pre>
  
  <p>But the,final translation in the video is done relative to final position after the rotations.(which is not same as the posx,posy,posz values I manipulate using mouse ).</p>
  
  <p>How to achive this kind of translations </p>