PDA

View Full Version : zoom in and out



edwong
11-09-2003, 10:37 PM
hi,
i have the view perspective like this

gluLookAt(5,5,10, -2,-2f-2, 0,1,0);

and i would like to make the up arrow key to zoom into the picture and make the down arrow key to zoom out the picture

any ideas how to do that?

thank you

Ed

cwc36
11-09-2003, 11:09 PM
Hi,

float z = 10.0f; //declare as global variable

gluLookAt(5,5,z, -2,-2,-2, 0,1,0);

if (key_up)z--;
if (key_down)z++;

Mazy
11-09-2003, 11:49 PM
zoom and moving closer are two different things. for zoom you should change the FOV value of gluPespective