[osg-users] how to judge if an object is in the frustum?

Trajce Nikolov NICK trajce.nikolov.nick at gmail.com
Mon Jun 27 00:15:27 PDT 2016


somthing like this:

struct MyCullCallback : public osg::NodeCallback
{
    void operator()(osg::Node* node, osg::NodeVisitor* nv)
    {
        osgUtil::CullVisitor* cv = nv->asCullVisitor();
        //osgUtil::CullVisitor* cv =
dynamic_cast<osgUtil::CullVisitor*>(nv);
        if (cv && cv->isCulled(node))
        {

        }
    }
};

node->setCullCallback(new MyCullCallback);

On Mon, Jun 27, 2016 at 9:15 AM, Trajce Nikolov NICK <
trajce.nikolov.nick at gmail.com> wrote:

> something like this:L
>
>
> On Mon, Jun 27, 2016 at 9:12 AM, John Lee <357059570 at qq.com> wrote:
>
>> Hi,
>> Thank you for your answer.
>> i can't find this method asCullVisitor(). I am using osg 3.4.0.
>> I am so sorry, and I am new to osg. So I wonder if  you can give me more
>> hint.
>> Thank you again.
>>
>>
>> Trajce Nikolov NICK wrote:
>> > Try CullCallback, in there you can get the handle of the CullVisitor
>> and do something like this in your callback:
>> >
>> >
>> > CullVisitor* cv = nv->asCullVisitor()
>> >
>> > cv->isCulled(node)
>> >
>> >
>> >
>> > On Mon, Jun 27, 2016 at 8:30 AM, John Lee < ()> wrote:
>> >
>> > > Hi,
>> > >
>> > > I don't know how to judge if an object is in the frustum? I want to
>> get which node is in the frustum.
>> > >
>> > > Thank you!
>> > >
>> > > Cheers,
>> > > John
>> > >
>> > > ------------------
>> > > Read this topic online here:
>> > > http://forum.openscenegraph.org/viewtopic.php?p=67832#67832 (
>> http://forum.openscenegraph.org/viewtopic.php?p=67832#67832)
>> > >
>> > >
>> > >
>> > >
>> > >
>> > > _______________________________________________
>> > > osg-users mailing list
>> > >  ()
>> > >
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> (
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>> )
>> > >
>> >
>> >
>> >
>> > --
>> > trajce nikolov nick
>> >
>> >  ------------------
>> > Post generated by Mail2Forum
>>
>>
>> ------------------
>> Read this topic online here:
>> http://forum.openscenegraph.org/viewtopic.php?p=67836#67836
>>
>>
>>
>>
>>
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> trajce nikolov nick
>



-- 
trajce nikolov nick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20160627/481e7748/attachment-0003.htm>


More information about the osg-users mailing list