Zooming the camera like for a sniper scope is very simple.
it can be done with a few lines of code like
f32 defaultFOV = camera->getFOV(); // this is in radians
f32 defaultAspect = camera->getAspectRatio();
f32 zoomFOV = 0.25f * M_PI;
camera->setFOV(zoomFOV);
//to unzoom reset the FOV to the defaultFOV
you might want to play around with the aspect ratio to make the imabe non squishy / stretched.
Additionally you can use an overlay image for the sniper scope.... it is also a good idea to make the weapon invisible in FPS type games while zooming.
How To Zoom
How To Zoom
---
Saurav Mohapatra
author, artist and bona fide geek
web: http://www.mohaps.com
email: mohaps AT gmail DOT com
Saurav Mohapatra
author, artist and bona fide geek
web: http://www.mohaps.com
email: mohaps AT gmail DOT com