title: How to transform 2D world to screen coordinates OpenGL
body: <p>I'm currently working on implementing an OpenGL powered renderer into a 2D game engine.</p>
  
  <p>Because the OpenGL screen coordinate space is [-1,1], I'm a little confused as to how it should be interfaced with a generic, Cartesian 2D world coordinate system.</p>
  
  <p>Let's say the viewport in my world is [-500,-500] to [1200, 1200], where [0, 0] is the world's origin.  Do I only need to translate and scale down to coordinates between -1 and 1?  Or is there some other form of transformation that needs to be performed?</p>
  
  <p>How do you calculate where to draw objects on screen that have defined positions in your own coordinate system?</p>
  
  <p>I would appreciate an explanation with and without glOrtho (so we can use the Z axis as well for perspective effects).</p>