Depth Problem

If you know the vertices of your object, basically the min and max of x, y, and z values for all. If you wanted to see all of it at the same time, your parameters to glOrtho should be less than the min and more than the max. But this should be done as

glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glViewPort(0,0,winwidth,winheight);
glOrtho(xleft,xright,ybottom,ytop,znear,zfar);
glMatrixMode(GL_MODELVIEW);

Make sure to maintain aspect ratio of window in the glOrtho command or it will appear distorted such that (xright - xleft)/(ytop - ybottom) = winwidth/winheight. Anything outside of the “box” formed by the glOrtho command will not be visible (it will be clipped).

Thats all you need to do. But, again, also verify that you are clearing the depth buffer, though if it is a static (non animated) rendering, it probably wouldn’t have any effect.

You should probably check out some of the tutorials on other sites which may give you more insight into OpenGL programming. I don’t think any are VB specific but you should be able to translate it into VB quite easily.

I thank all of you from bottom of my heart specially shinpaughp for your kind patience and help. IT WORKED!!

Just for your information, I added all the lines that shinpaughp had suggested, except the ViewPort, to the end of StartUpRC routine (as I had the ViewPort routine called in my Window-Resize sub.) and it works just fine.

I thank you all again.