glOrtho and Clipping Planes

First of all, thanks to everyone for all the help I have been getting. It is great to be able to come to a forum and have questions resolved (even though they are probably easy for all the experts).

I am trying to fit an image in a OpenGL window and it appears to be getting “clipped” when I rotate it. I am using glOrtho() because it seemed to be the easiest to start with. The image I am “drawing” is a series of Triangular polygons that are very large in number (~58,000). A small snippet of the code I am using follows (using the Java OpenGL bindings JOGL):


public void reshapeGLAutoDrawable drawable, int x, int y, int width, int height) {
GL gl = drawable.getGL();
gl.glViewport(0, 0, width, height);
gl.glMatrixMode(GL.GL_PROJECTION);
gl.glLoadIdentity();
gl.glOrtho(-50, 50, -50, 50, -50, 50);
gl.glMatrixMode(GL.GL_MODELVIEW);

}// End of reshape()

The Image looks great, just when I rotate it the ends are visibly “clipped” at certain points. I am sure this is probably a simple problem that maybe just needs some “tweeking” but I just wanted to make sure it wasn’t something obvious in my code first. ANY help/hints would be great.

Thanks in advance.

Never mind,

I just found the problem (it was some stupidity on my part). I just shifted the near and far parameters to increase in magnitude. However, since I chose glOrtho in the first place just for simplicity - can anyone suggest a better function? The desire is for a more realistic rendering, not necessarily the one provided by glOrtho.

Thanks

The desire is for a more realistic rendering, not necessarily the one provided by glOrtho.
What do you mean by ‘more realistic’?
If you want 3D rendering, then you should use glFrustum and enable depth test.

I guess I am looking for something that can allow me to zoom in and out on an image in the most efficient way.

Am I right, that greater magnitude between near and far means more artifact on the rendered scene?

@Richard145:
Simplest way to zoom is to use gluPerspective and change the field of view parameter.
With glOrtho you can “zoom” only by changing the left, right, bottom, and top parameters.

@Dum:
Yes, the smaller the ratio zFar/zNear the better the depth buffer precision (while using the same number of depth bits).

Thanks to everyone for all the input. I will certainly give the gluPerspective a try.