I am using the code snippet below to switch between orthogonal and perspective projections based on the user's selection. However, irrespective of the user's choice the rendered model is always in orthogonal projection. Could you please let me know what am I missing here.
As seen above, the perspective projection obtained currently is just a zoomed in version of the orthogonal projection.
Thank you.
float fov = 10.0;
float Oleft = -1.0, Oright = 1.0, Obottom = -1.0, Otop = 1.0;
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
if(proj_type==0)
gluPerspective(fov, 1, 0.1, 200);
else
glOrtho(Oleft, Oright, Obottom, Otop,0.1,50);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
gluLookAt(10, 7, 10, 0, 0, 0, 0, 1, 0);