PDA

View Full Version : glulookat not zooming!



macsam
01-28-2013, 02:42 AM
Hi,
I have a model which I can see using gluLookat, I can see the model rotating using glRotated, but if I try and zoom into the model

from: gluLookAt( 0.0, 0.0, 500.0F, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 );
to:gluLookAt( 0.0, 0.0, 50.0F, 0.0, 0.0, 0.0, 0.0, 1.0, 0.0 );

there is no change untill the Z value is a value such that the view is the other side of the model when I see a blank screen as one would expect. Anyone got any ideas? Any help gratefully appreciated.

tonyo_au
01-28-2013, 08:28 PM
I would check the rest of your code - those 2 gluLookAts will not render the same thing.

Carmine
01-28-2013, 11:55 PM
gluLookAt specfies a viewing direction and camera orientation.
It does not define a projection. If you are using an orthographic
projection in your code, your two gluLookAt's should give you the
same view of your model. The model will only appear to zoom if
you use a perspective projection (gluperspective) in conjunction
with gluLookAt.

V-man
01-29-2013, 05:45 AM
You have to move the eye and center values. That doesn't actually do a zoom, it just translates the camera.
If you want to do a zoom, you have to make changes to the projection matrix.

tonyo_au
01-29-2013, 04:01 PM
If you want to do a zoom, you have to make changes to the projection matrix.
Be aware that if you do this your image can look distorted - like using a wide angle lens on a camera