Zoom Window Problem

Dear all:

Can you show me some tips to create the zoom window effect??? I have tried with glorto, but i can not get the effect i want??
what can i do? and where i can get the information about that??
I implement my app under windows by mfc!

ortho has no sense of depth so zoom cant work try gluPerspective(FOV …
make the FOV smaller to ‘zoom in’

You need to do two (or 3) pass rendering (of course).

One method (better if you want strange shaped zoom area) is to render the shape in the stencil and then re render the scene with changed camera using the stencil.

If you have square/rectangular regions it’ faster to use scissors, render your scene, create the right scissors for the zoom region and re render the scene with changed camera.

rIO
http://www.spinningkids.org/umine

Great News there !

ooops, maybe I’ve understhood the wrong way, did u intend the “sniper zoom” effect ? If not ignore my previous post.

rIO http://www.spinningkids.org/umine

I think you meant zooming on a rectangular marked area in a 3D window? Like in a CAD-System or Modeller? Then do it in Orthographic mode, it’s much easier.

You bring up something id like to implement…How would you go about marking that rectangular area? (drawing a box with mouse as in CAD modeller)

Originally posted by zed:
ortho has no sense of depth so zoom cant work try gluPerspective(FOV …
make the FOV smaller to ‘zoom in’

Thanks for your reply,I would like to implement a CAD-System zoom window effect like Kilam Malik say.Do u have any idea about it??

Originally posted by Kilam Malik:
I think you meant zooming on a rectangular marked area in a 3D window? Like in a CAD-System or Modeller? Then do it in Orthographic mode, it’s much easier.

yep! that the effect i would like to implement. can u show me some tips?? all i have is the marked area point data…in my code the marked area do not in the center of my view…

Originally posted by rIO:
ooops, maybe I’ve understhood the wrong way, did u intend the “sniper zoom” effect ? If not ignore my previous post.

u have not misunderstood my meaning.I am new for opengl programming,can u show me some tips?? by the way…what is scissors???
thanks in advance…

Originally posted by link19:
You bring up something id like to implement…How would you go about marking that rectangular area? (drawing a box with mouse as in CAD modeller)

i implement that by capture the mouse event.
mouse left button dowm:record the point and then translate it to object coordinate.
mouse move: draw the marked area
mouse left button dowm again: end of draw marked area…and get translated end point…

chuck this at the start of your code loop
glScalef(zoom,zoom,zoom)
u might need to turn on normalization if youre using lighting

glNormalize costs a lot of performance. I suggest to let the user draw the rectangle, then calculate the position of the zoom window in 3D-Space (by gluUnproject) and then use these coordinates as your glOrtho parameters for the bounding.

Thank u all…I seem to solve my problem!!
I love u all…^^

glNormalize costs a lot of performance. I suggest to let the user draw the rectangle, then calculate the position of the zoom window in 3D-Space (by gluUnproject) and then use these coordinates as your glOrtho parameters for the bounding.

I just have to use the coordinates of the rectangle as the parameters for glOrtho? or I have to do some special process.
Thank you for the moment
Best regards
Kurt

Yes, you can do that. But do a gluUnProject before, to determine the coordinates of the rectangle in 3D-Space.

Kilam.

Thank you Kilam, I’ll try.