Bra'Tac
04-02-2001, 05:56 AM
Hello, i want to make a zoom on an object and my code don't work. Here is what I wrote in my loopback fonction when the mouse moves and the right button is pressed and after I recalculate my zoom variable.
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective((GLfloat)45.0f*(1.0+zoom),(GLfloat) largeur/(GLfloat)hauteur,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
gluPerspective((GLfloat)45.0f*(1.0+zoom),(GLfloat) largeur/(GLfloat)hauteur,0.1f,100.0f);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();