[osg-users] Zoom in to special area and special object

Johny Canes psijsma at gmail.com
Wed Feb 22 00:50:13 PST 2017


Hi,

I'm not sure how redundant it is to say this, but you could use a field-of-view zoom. This would be closest to a camera zoom that I can think of.

I am a beginner with the library and this is probably not the neatest way to do it, but here's a snippet.

Code:

double fovy, aspectRatio, zNear, zFar;

camera->getProjectionMatrix().getPerspective(fov, aspectRatio, zNear, zFar);
fov = 45;
camera->getProjectionMatrix().makePerspective(fov, aspect, zNear, zFar);



You may just want to move the camera closer though, a field-of-view zoom is kind of dingy.

Thank you!

Cheers,
Johny

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70305#70305








More information about the osg-users mailing list