<p>I've drawn an ellipse in the XZ plane, and set my perspective slightly up on the Y-axis and back on the Z, looking at the center of ellipse from a 45-degree angle, using gluPerspective() to set my viewing frustrum.</p>

<p><a href="http://www.flickr.com/photos/rampion/2863703051/" rel="nofollow noreferrer" title="ellipse by rampion, on Flickr"><img src="https://farm4.static.flickr.com/3153/2863703051_a768ed86a9_m.jpg" width="240" height="187" alt="ellipse" /></a></p>

<p>Unrotated, the major axis of the ellipse spans the width of my viewport.  When I rotate 90-degrees about my line-of-sight, the major axis of the ellipse now spans the height of my viewport, thus deforming the ellipse (in this case, making it appear less eccentric).</p>

<p><a href="http://www.flickr.com/photos/rampion/2863703073/" rel="nofollow noreferrer" title="rotated ellipse by rampion, on Flickr"><img src="https://farm4.static.flickr.com/3187/2863703073_24c6549d4b_m.jpg" width="240" height="187" alt="rotated ellipse" /></a></p>

<p>What do I need to do to prevent this deformation (or at least account for it), so rotation about the line-of-sight preserves the perceived major axis of the ellipse (in this case, causing it to go beyond the viewport)?</p>

[{'answer_id': 79449, 'author': 'shea241', 'author_id': 14656, 'author_profile': 'https://Stackoverflow.com/users/14656', 'pm_score': 4, 'selected': True, 'text': "<p>It looks like you're using 1.0 as the aspect when you call gluPerspective().  You should use width/height.  For example, if your viewport is 640x480, you would use 1.33333 as the aspect argument.</p>\n"}, {'answer_id': 79459, 'author': 'Martin', 'author_id': 2581, 'author_profile': 'https://Stackoverflow.com/users/2581', 'pm_score': 2, 'selected': False, 'text': '<p>According to the OpenGL Spec:</p>\n\n<pre><code>void gluPerspective( GLdouble fovy,\n                     GLdouble aspect,\n                     GLdouble zNear,\n                   GLdouble zFar )\n</code></pre>\n\n<p>Aspect should be a function of your window width and height. Specifically width divided by height (but watch out for division by zero).</p>\n\n<p>Perhaps you are using 1 as the aspect which is not accurate unless your window is a square.</p>\n'}, {'answer_id': 79483, 'author': 'Jeff Hill', 'author_id': 14742, 'author_profile': 'https://Stackoverflow.com/users/14742', 'pm_score': 1, 'selected': False, 'text': '<p>It looks like the aspect parameter on your gluPerspective call need tweaking.  See <a href="http://www.opengl.org/documentation/specs/man_pages/hardcopy/GL/html/glu/perspective.html" rel="nofollow noreferrer">The Man Page</a>.  If your window were physically square, the aspect ratio would be 1 and your problem would go away.  However, your window is rectangular, so the viewing frustum needs to be non-square.</p>\n\n<p>Set the aspect ratio to window_width / window_height, and your ellipse should look correct.  Note that you\'ll need to update this whenever the window resizes; if you\'re using GLUT set a <a href="http://developer.apple.com/documentation/Darwin/Reference/ManPages/man3/glutReshapeFunc.3.html" rel="nofollow noreferrer">glutReshapeFunc</a> and recalculate the projection matrix in there.</p>\n'}]
['https://Stackoverflow.com/questions/79360', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/9859/']