PDA

View Full Version : Zooming in Ortho



11-28-2000, 11:59 AM
I have a code in which you can switch between perspective and orthographics projections. in perspective one can simply zoom on the model by translating along the screen Z axis; this clearly will not work in ortho and in ortho i use scaling. since i am using two different methods to perform zooming, when i then switch between the ortho and perspective projections the model is usually not visible.

how can i do the zooming consistently in the two projection modes ? should i use glFrustum and glOrtho directly; any example code would be very helpful.

Thanks

phlake
11-28-2000, 12:32 PM
moving the camera is actually "dollying". to zoom in perspective, change the field of view (fov), which is the angle of the frustum.

then you could equate the ortho view to a box aligned with the direction of the perspective camera. when the fov is widened or narrowed, the ortho view should expand or contract.

jc
11-29-2000, 01:17 AM
Hi, i actually use a graphic in 2D so i use glOrtho function.

void glOrtho( GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top,
GLdouble zNear,
GLdouble zFar )

To zoom i just change the left, rigth, bottom and top parameters. Diong this, i do not scale or change the geometry of the graphic.

Hope that helps

Ramesh
11-29-2000, 02:54 AM
Hi
The following function helps to zoom it. When I enlarge,a part of the object is invisible. Is there any method to put scroll bars to reach any part of screen.

void glOrtho( GLdouble left,
GLdouble right,
GLdouble bottom,
GLdouble top,
GLdouble zNear,
GLdouble zFar )