[osg-users] [forum] How to set field of view of second slave camera?

Milos Stefcak milos.stefcak at gmail.com
Wed Oct 4 06:29:17 PDT 2017


Hi,

I have problem to set field of view od second slave camera. I used it like lens, but when I on lens camera, distance of my "grapf" is incorect. My lens camera is smaler as you can see in the pic.



Lens option:
osg::ref_ptr<osg::Camera> lensCamera = new osg::Camera;
lensCamera->setCullMask(0x2);
lensCamera->setGraphicsContext(viewerWidget >getGraphicsWindow());
lensCamera->setViewport(new osg::Viewport((viewerWidget->width()/4),(viewerWidget->height()/4),viewerWidget->width()/2,viewerWidget->height()/2));
lensCamera->setReferenceFrame(osg::Transform::RELATIVE_RF);
viewerWidget->addSlave(lensCamera.get(), osg::Matrix(), osg::Matrix(), true);

I tried something like this : viewerWidget->addSlave(lensCamera.get(), osg::Matrix::scale(2,2,2),osg::Matrixd()); but scale doesnt work. Anyone help me?        


Thank you!

Cheers,
Milos

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




Attachments: 
http://forum.openscenegraph.org//files/goal_129.png
http://forum.openscenegraph.org//files/withlens_141.png
http://forum.openscenegraph.org//files/nolens_743.png




More information about the osg-users mailing list