Zoom Window

Hello guys!
I need to implement a zoom window in my application, but I don’t know how to do this can someone show me …

Thank you for the moment

Best regards

Kurt

PS.: It is really important, it will save my life.

Don´t know what you want exacly but if you want that “Sniper-Rifle” Zoom just decrease the fov-angle…

HTH, XBTC!

There is a function that does what you want:
glScale*

NewROmancer

Ok NewROmancer,

But how can I calculate the factor that I will put in glScale()? The data that I’ve is the size of the screen, and also the size of therectangle that select a specific region . How is it possible ?

Thank you for the moment

Best regards

Kurt

You will find in glut.tar.Z files a example call “zoomdino.c” it a good start to make a zoom.

<http://reality.sgi.com/mjk_asd/OpenGLforX.html>

Teh function is like:
glScalef(1,1,window_Sz/rect_sz);
where window_Sz= window size and
rect_sz= rectangle size.
Maybe I messed the parameters but you have to multiply the matrix with window_Sz/rect_sz for the z axis.

NewROmancer

I’m sure you could use the gluLookAt function and pass some variables such as x, y, and z to the eye location and then put in whatever event handler is used (eg, mouse click, key press, button press) that the z factor would increase/decrease and call the function that renders the scene.

cwhite40

Originally posted by NewROmancer:
[b]Teh function is like:
glScalef(1,1,window_Sz/rect_sz);
where window_Sz= window size and
rect_sz= rectangle size.
Maybe I messed the parameters but you have to multiply the matrix with window_Sz/rect_sz for the z axis.

NewROmancer[/b]

Using glScale will slow your app down because your normal vectors will be scaled also. So you have to scale them down by yourself or use glNormalize. Both will slow down your application.
Try to calculate the parameters for the gluLookAt or glFrustum.

Ok Ok,

So I will work to implement it, using gluLookAt function. Thank you very much guys!!

Best regards

Kurt