PDA

View Full Version : Zoom Window Problem



shincheng
02-15-2001, 12:04 AM
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!

zed
02-15-2001, 12:28 AM
ortho has no sense of depth so zoom cant work try gluPerspective(FOV ....
make the FOV smaller to 'zoom in'

rIO
02-15-2001, 12:29 AM
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 !

rIO
02-15-2001, 12:31 AM
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

Kilam Malik
02-15-2001, 01:49 AM
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.

link19
02-15-2001, 07:14 AM
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)

shincheng
02-15-2001, 03:58 PM
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??

shincheng
02-15-2001, 04:04 PM
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......

shincheng
02-15-2001, 04:08 PM
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....

shincheng
02-15-2001, 04:16 PM
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....

zed
02-15-2001, 04:21 PM
chuck this at the start of your code loop
glScalef(zoom,zoom,zoom)
u might need to turn on normalization if youre using lighting

Kilam Malik
02-15-2001, 11:09 PM
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.

shincheng
02-15-2001, 11:19 PM
Thank u all......I seem to solve my problem!!
I love u all.....^^

KurtCob
02-26-2001, 02:40 AM
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

Kilam Malik
02-27-2001, 01:26 AM
Yes, you can do that. But do a gluUnProject before, to determine the coordinates of the rectangle in 3D-Space.

Kilam.

KurtCob
02-28-2001, 02:14 AM
Thank you Kilam, I'll try.