Re: [osg-users] How to set maximum visible distance?
HI Daven, The best way to achieve this would be to enable the view frustum near and far culling planes and to disable the automatic computation of the near/far distances. Both these settings can be found in include/osg//CullSettings, osg::CullSettings is inherited by the osg::Camera, so you set set them via the viewer's master Camera. Robert On 13 February 2017 at 22:14, Daven Hem wrote: > Hello, everyone! > I want to set maximum visible distance of camera as 5000m. > I mean I want to render only objects and terrains that are in 5000m from > camera. > How can I do that? Please teach me. > Cheers. > Daven. > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=70179#70179 > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to set maximum visible distance?
Hi, Robert! Thanks for your teaching. I'll try it. Cheers, Daven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70186#70186 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to set maximum visible distance?
Hello, Robert! It works surely. But how can I set maximum distance 5000 in meters? Thank you! Cheers, Daven -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70187#70187 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] How to set maximum visible distance?
On 14 February 2017 at 16:07, Daven Hem wrote: > Hello, Robert! > It works surely. > But how can I set maximum distance 5000 in meters? You set the zfar to 5000 when setting up the Camera's projection matrix. Have a look at the Camera::setProjectionMatrixAsFrustum/Perspetive() methods, and also look at the OpenGL GLU docs for the associated GLU functions. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org