Archived

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

Zooming in effects

This topic is 5435 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''ve seen it loads of times in games when a camera seems to zoom in to get a better look at something, normally with sniper rifles... so does anyone knoe how it''s done? --helicon56.

Share this post


Link to post
Share on other sites
lol, i''m pretty sure it''s not done like that. it''s like it is actually zooming in, in the way that a real camera does, by enlarging a certain part of it''s view. it''s difficult to explain, but you probably know what i mean.

Share this post


Link to post
Share on other sites
the way zooming is done in real life & in games is set the horizontal field of view smaller. As this make all objects take a larger amount of the fov & hence make objects seem larger

hope this helped
Iain

Share this post


Link to post
Share on other sites
In 3d grafx, there is also the zoom that occurs while looking through the scope of a rifle, or makes objects larger.

The way I acclompish this is by moving the camera closer to the objects. I get 0 performance hit this way.



Techlead
www.myran.com/enilno

Share this post


Link to post
Share on other sites
you change the field of view (frustrum) to create the zoom effect. The difference between moving the camera and changing fov is that the perspective is nearing orthogonal view (loosing perspective) So you don''t move the camera.

____________________________________________________________
Try RealityRift at www.planetrift.com

Share this post


Link to post
Share on other sites
Not that much more expensive I would think (I can''t be sure since in all honesty I haven''t measured it). The point is that it looks better though.

____________________________________________________________
Try RealityRift at www.planetrift.com

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Uhhhh, just moving the camera closer is definitely not the way to go. What if you''re looking at a wall and you decide to zoom? Whoops, now you''ve placed the camera outside or nextdoor or something.

The proper way to do it is to lower the field of view of the camera, as someone above suggested.

-- John

Share this post


Link to post
Share on other sites
In DirectX you can do that this way:

float p_Zoom = 1.0f;
D3DXMATRIX ProjectionMatrix;
D3DXMatrixPerspectiveFovRH( &ProjectionMatrix, p_Zoom, 640.0f/480.0f, p_MinViewDistance, p_MaxViewDistance );

Now you only need to update the ''p_Zoom'' variable


KaMiKaZe

Share this post


Link to post
Share on other sites
Yes! The right way to achieve the zoom effect is altering the Fov of the projection matrix. The human Fov is near to 50 degrees, try reducing it up to 5 degrees to simulate a zoom in effect and backwards to 50 to produce a zoom out. Remember I said degrees not radians

Share this post


Link to post
Share on other sites