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

2016-06-27 Thread John Lee
Nick.
Ok, thank you so much. I will look up more information about what Robert said.


Trajce Nikolov NICK wrote:
> Hi,
> 
> 
> well, for this I think what Robert suggested suits better. I don't know the 
> details of the Polytope that much but I think you just need to re-create the 
> View frustum as a Polytope and do the intersectons... I hope Robert will shed 
> more light into this
> 
> 
> 
> 
> On Mon, Jun 27, 2016 at 10:20 AM, John Lee < ()> wrote:
> 
> > Hi, robert.
> > Thank you for your reply.
> > I never use the PolytopeIntersector, can you tell me more hints? Because i 
> > am new to osg or show me some website so that i learn osg quickly.
> > Thanks.
> > 
> > Jhon.
> > 
> > 
> > robertosfield wrote:
> > 
> > > Hi John,
> > > 
> > > 
> > > As Nick suggest you can use a cull callback to report back when a node
> > > and it's subgraph are likely to be within the view frustum, however,
> > > this is constrains you to doing the test in the cull traversal.
> > > 
> > > However, if you want to do the test outside the cull traversal then
> > > you'll need to use the PolytopeIntersector, creating a Polytope as the
> > > frustum.
> > > 
> > > Robert.
> > > 
> > > On 27 June 2016 at 07:30, 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)
> > > > 
> > > > 
> > > ___
> > > osg-users mailing list
> > > 
> > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org 
> > > (http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org)
> > > 
> > >   --
> > > Post generated by Mail2Forum
> > > 
> > 
> > 
> > --
> > Read this topic online here:
> > http://forum.openscenegraph.org/viewtopic.php?p=67841#67841 
> > (http://forum.openscenegraph.org/viewtopic.php?p=67841#67841)
> > 
> > 
> > 
> > 
> > 
> > ___
> > 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=67844#67844





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-06-27 Thread Trajce Nikolov NICK
Hi,

well, for this I think what Robert suggested suits better. I don't know the
details of the Polytope that much but I think you just need to re-create
the View frustum as a Polytope and do the intersectons... I hope Robert
will shed more light into this



On Mon, Jun 27, 2016 at 10:20 AM, John Lee <357059...@qq.com> wrote:

> Hi, robert.
> Thank you for your reply.
> I never use the PolytopeIntersector, can you tell me more hints? Because i
> am new to osg or show me some website so that i learn osg quickly.
> Thanks.
>
> Jhon.
>
>
> robertosfield wrote:
> > Hi John,
> >
> >
> > As Nick suggest you can use a cull callback to report back when a node
> > and it's subgraph are likely to be within the view frustum, however,
> > this is constrains you to doing the test in the cull traversal.
> >
> > However, if you want to do the test outside the cull traversal then
> > you'll need to use the PolytopeIntersector, creating a Polytope as the
> > frustum.
> >
> > Robert.
> >
> > On 27 June 2016 at 07:30, 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
> > >
> > >
> > >
> > >
> > >
> > > ___
> > > osg-users mailing list
> > >
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > >
> > ___
> > osg-users mailing list
> >
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >  --
> > Post generated by Mail2Forum
>
>
> --
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=67841#67841
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-06-27 Thread John Lee
Hi, robert.
Thank you for your reply.
I never use the PolytopeIntersector, can you tell me more hints? Because i am 
new to osg or show me some website so that i learn osg quickly.
Thanks.

Jhon.


robertosfield wrote:
> Hi John,
> 
> 
> As Nick suggest you can use a cull callback to report back when a node
> and it's subgraph are likely to be within the view frustum, however,
> this is constrains you to doing the test in the cull traversal.
> 
> However, if you want to do the test outside the cull traversal then
> you'll need to use the PolytopeIntersector, creating a Polytope as the
> frustum.
> 
> Robert.
> 
> On 27 June 2016 at 07:30, 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
> > 
> > 
> > 
> > 
> > 
> > ___
> > osg-users mailing list
> > 
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > 
> ___
> osg-users mailing list
> 
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> 
>  --
> Post generated by Mail2Forum


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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-06-27 Thread John Lee
HI, Nick.
Thank you so much for your answer.
I will try this. I have one more question. How to detect if a node's bounding 
box collision with the camera view frustum. Can i solve this problem with  
osgUtil::CullVisitor?


Trajce Nikolov NICK wrote:
> 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(nv);
>         if (cv && cv->isCulled(node))
>         {
>             
>         }
>     }
> };
> 
> node->setCullCallback(new MyCullCallback);
> 
> 
> On Mon, Jun 27, 2016 at 9:15 AM, Trajce Nikolov NICK < ()> wrote:
> 
> > something like this:L
> > 
> > 
> > 
> > On Mon, Jun 27, 2016 at 9:12 AM, John Lee < ()> 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) 
> > > > > (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)
> > > > >  
> > > > > (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 
> > > (http://forum.openscenegraph.org/viewtopic.php?p=67836#67836)
> > > 
> > > 
> > > 
> > > 
> > > 
> > > ___
> > > 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
> > 
> > 
> > 
> 
> 
> 
> -- 
> trajce nikolov nick
> 
>  --
> Post generated by Mail2Forum


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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-06-27 Thread Trajce Nikolov NICK
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(nv);
if (cv && cv->isCulled(node))
{

}
}
};

node->setCullCallback(new MyCullCallback);

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

> something like this:L
>
>
> On Mon, Jun 27, 2016 at 9:12 AM, John Lee <357059...@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@lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>
>
>
> --
> trajce nikolov nick
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-06-27 Thread Trajce Nikolov NICK
something like this:L


On Mon, Jun 27, 2016 at 9:12 AM, John Lee <357059...@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@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-06-27 Thread John Lee
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@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-06-27 Thread Robert Osfield
Hi John,


As Nick suggest you can use a cull callback to report back when a node
and it's subgraph are likely to be within the view frustum, however,
this is constrains you to doing the test in the cull traversal.

However, if you want to do the test outside the cull traversal then
you'll need to use the PolytopeIntersector, creating a Polytope as the
frustum.

Robert.

On 27 June 2016 at 07:30, John Lee <357059...@qq.com> 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
>
>
>
>
>
> ___
> 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 judge if an object is in the frustum?

2016-06-27 Thread Trajce Nikolov NICK
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 <357059...@qq.com> 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
>
>
>
>
>
> ___
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


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

2016-06-27 Thread John Lee
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





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org