PDA

View Full Version : How to add a zoom function



mick
04-22-2004, 03:27 AM
Hello everyone,
I am looking for an easy way to zoom on a part of a scene. For the moment I use gluPickMatrix() to give the part of the window I want my zoom on and then I call gluPerspective(). The problem is I don't get my zoom on the rectangle I was hoping, it goes somewhere else...
So I would like to know if it is a (good) way to do it or not and if not, can everyone give me another method....I can't find examples on the web.
Thank you for your help :)

mikael_aronsson
04-22-2004, 04:18 AM
You can just change the field of view parameter in your perspective projection.

Mikael

mick
04-22-2004, 04:34 AM
Yes I have seen this easy way, thank you for your reply. But at the moment I can select a box to zoom on so I would like to zoom exactly on this box, with gluPerspective I will zoom on the center point (right?), not exactly on my box....I can try to put the center of my box in the middle of the viewport and then zoom...No?
If anyone knows how I could achieve that simply....thank you to let me know :)

charliejay
04-22-2004, 08:13 AM
Use a combination of gluLookAt, and fov.