PDA

View Full Version : Zoom Window



KurtCob
09-18-2000, 03:28 AM
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.

XBCT
09-18-2000, 07:47 AM
Donīt know what you want exacly but if you want that "Sniper-Rifle" Zoom just decrease the fov-angle....

HTH, XBTC!

NewROmancer
09-18-2000, 11:16 PM
There is a function that does what you want:
glScale*

NewROmancer

KurtCob
09-19-2000, 01:09 AM
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

bern
09-20-2000, 03:17 AM
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>

NewROmancer
09-21-2000, 01:59 AM
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

cwhite40
09-23-2000, 01:15 PM
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.

http://www.opengl.org/discussion_boards/ubb/eek.gif cwhite40 http://www.opengl.org/discussion_boards/ubb/eek.gif

Kilam Malik
09-25-2000, 12:57 AM
Originally posted by NewROmancer:
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

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.

KurtCob
09-25-2000, 01:04 AM
Ok Ok,

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

Best regards

Kurt