bogaat
04-09-2000, 08:00 AM
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(xmin*2.0, xmax*2.0, ymin*2.0, ymax*2.0, zmin*2.0, -zmax*2.0);
glMatrixMode(GL_MODELVIEW);
glutPostRedisplay();
}
void draw_perspective(){
//glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(40, 1, zmin*2.0, -zmax*2.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 ;]
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(xmin*2.0, xmax*2.0, ymin*2.0, ymax*2.0, zmin*2.0, -zmax*2.0);
glMatrixMode(GL_MODELVIEW);
glutPostRedisplay();
}
void draw_perspective(){
//glViewport(0, 0, w, h);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective(40, 1, zmin*2.0, -zmax*2.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 ;]