Skip to main content
gamedev.net
🔒 Locked

zooming

Started by redrum 3 replies 450+ views
Original Post
redrum
redrum
Hi, i am working on a fps, and i am trying to add a zoom effect for my sniper weapon. Whatever i tried did not work, i tried to use glScalef and gluPerspective but no way. What am i doing wrong? Thanks for your help.
Sneftel
Sneftel
gluPerspective is the key. Just decrease your fov and the view should become magnified. That''s what real telescopes do, after all.


"Sneftel is correct, if rather vulgar." --Flarelocke
redrum
redrum
i used this code to modify fov but it did not help

glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity(); //very important
gluPerspective(35, ratio, 1, 1000);
Rasmadrak
Rasmadrak
it should be gluPerspective(ratio,"value","value","value");

the first variable in gluPerspective is the FOV in degrees... =)
hope it helps!
"Game Maker For Life, probably never professional thou." =)
redrum
redrum
if you can send me a bit of code that would be great because i have a presentation tomorrow and i still cannot zoom using gluPerspective.
The view does not change even a little when i press the right mouse button.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.