View Full Version : Zooming in Orthographic view?
How can we do zooming in Orthographiic view (glOrtho)? Thanx in advance.
03-15-2001, 08:39 PM
Maybe someone better suited to answer this but I would say use gluPerspective or glFrustrum to move the camera in.
gluPerspective(angle from 0-180, aspect ratio(w/h), near cliping plane, far clipping plane);
glFrustrum(left, right, bot, top, near, far);
*note: these will both give you perspective though. Ortho doesnt.
Thanx for the reply but the problem is actually to be solved in orthoview only. thats why i need to use glOrhto. 3D studio uses it. I'm sure there is another way to apply zooming in ortho....
er, yer, see, that would be in perspective projection mode, which isn't orthogonal projection. =)
To work out the answer, all you need to do (!!) is think about the camera set up and what you want to happen. Suppose you have an object which is 100 units tall, and you want it to fill the height of the screen (ie. we're ignore width for now), then an appropriate gluOrtho2D might look like:
gluOrtho2D(-x, x, 0.0, 100.0); (where x is some left/right coordinate)
if you wanted to zoom the camera, then what you're doing ir *projecting a subset of the frame to the same area of the screen*. so, 2x zoom in this case (which would only look at half o the object) is thus:
gluOrtho2D(-x/2, x/2, 0.0/2, 100.0/2.0)...
u could also do
glScalef(....) ;< )
wer meines speeres spitze furctet? doorschreite das fuer nie
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.