title: Playing Card "3D" rotation in OpenGL - perspective?
body: <p>(Mac OS X, Cocoa, C/C++, OpenGL, somewhat mathematically challenged.)</p>
  
  <p>Project is a real-time (30fps) poker game, with a 2D view. The OpenGL view is set up for Orthographic projection using glOrtho; the camera is always looking directly down at the cards/table. To date, it's essentially been a 2D image composition engine.</p>
  
  <p>My playing cards are pre-built textures (with alpha), rendered thusly:</p>
  
  <pre><code>glBegin(GL_TRIANGLE_STRIP);
      glTexCoord2f(0.0, 0.0);
      glVertex3d(startDraw_X, startDraw_Y, 0.0);
  
      glTexCoord2f(1.0, 0.0);
      glVertex3d(endDraw_X, startDraw_Y, 0.0);
  
      glTexCoord2f(0.0, 1.0);
      glVertex3d(startDraw_X, endDraw_Y, 0.0);
  
      glTexCoord2f(1.0, 1.0);
      glVertex3d (endDraw_X, endDraw_Y, 0.0);
  glEnd();
  </code></pre>
  
  <p>This works well, and provides 1:1 pixel mapping, for high image quality.</p>
  
  <p><strong>QUESTION:</strong> how can I (cheaply, quickly) "flip" or distort my card using OpenGL? The rotation part isn't hard, but I'm having trouble with the perspective aspect.</p>
  
  <p>Specifically, I have in mind the horizontal flipping action of UIViews in iPhone applications (e.g. Music). The UIView will appear to flip by <strong>shrinking horizontally, with the appearance of perspective</strong> (the "rear" coordinates of the view will shrink vertically.)</p>
  
  <p>Thanks for any help or tips.  </p>