help switching between glortho and gluperspective

Hello,
I am having a problem switching between these two projection modes. I have two menu options, from which I am to switch between modes. Each menu option calls a function ,for ex.

void draw_ortho(){
//glViewport(0, 0, w, h);//hrm
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glOrtho(xmin2.0, xmax2.0, ymin2.0, ymax2.0, zmin2.0, -zmax2.0);
glMatrixMode(GL_MODELVIEW);
glutPostRedisplay();
}

void draw_perspective(){
//glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(40, 1, zmin2.0, -zmax2.0);
glMatrixMode(GL_MODELVIEW);
glutPostRedisplay();
}

I am new to this and I would greatly appreciate any wisdom that someone could give me. Be well, bogaat ;]

Switching between perspective and orthographic views takes more than just switching the projection matrix. You need to think about the position of the viewing volume with respect to the viewpoint. For instance, if front clipping plane is very close to the camera in perspective mode, what you will have is a camera with a wide field of view. However, in orthographic mode, things will look good.

If you can describe what you are seeing when you switch between ortho and perspective, I can provide better information.

Actually when I switch between the two views nothing happens. I believe that I am not using them correctly or not using another call w/ them correctly. When I comment out the ortho and gluperspect lines it does the same thing. So obviously, I am not doing something right. I have a reshape func which uses glOrtho w/ glViewport. You may notice I have commented out the glViewport calls w/in the two functions. Do I need them? I will be working on this all day today, so ANY comments will help Thanks again, Bogaat

Ok, so this is my newest failure…ne suggestions?
void reshape(int w, int h){
glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
switch(flag) {
case 0: {
if (w <= h)
glOrtho(-4.0, 4.0, -4.0 * (GLfloat) h / (GLfloat) w,
4.0 * (GLfloat) h / (GLfloat) w, -10.0, 10.0);
else
glOrtho(-4.0 * (GLfloat) w / (GLfloat) h,
4.0 * (GLfloat) w / (GLfloat) h, -4.0, 4.0, -10.0, 10.0);
}
case 1:
gluPerspective(10, 2, zmin2.0, -zmax2.0);
case 2:
glOrtho(xmin20, xmax20, ymin20, ymax20, zmin20, -zmax20);
}
glMatrixMode(GL_MODELVIEW);
}

Bump… I’m having the same problem when I switch between modes nothing happens… ARGHH

WDA