Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

redrum

zooming

This topic is 5283 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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.

Share this post


Link to post
Share on other sites
Advertisement
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

Share this post


Link to post
Share on other sites
i used this code to modify fov but it did not help

glMatrixMode(GL_PROJECTION);
glPushMatrix();
glLoadIdentity(); //very important
gluPerspective(35, ratio, 1, 1000);

Share this post


Link to post
Share on other sites
it should be gluPerspective(ratio,"value","value","value");

the first variable in gluPerspective is the FOV in degrees... =)
hope it helps!

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!