PDA

View Full Version : Zooming in Orthographic view?



03-15-2001, 09:29 PM
How can we do zooming in Orthographiic view (glOrtho)? Thanx in advance.

maui059
03-15-2001, 09: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.

03-15-2001, 10:09 PM
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....

john
03-15-2001, 10:11 PM
hello,

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)...

see?

cheers
John

zed
03-16-2001, 03:25 AM
u could also do
glOrtho(..)
glScalef(....) ;< )

wer meines speeres spitze furctet? doorschreite das fuer nie