Re: [osg-users] Insersector doesn't take into account DrawableCullCallback result
Hi Davide, to addition to Robert - the way how I resolved similar case in the past was indeed by having the NodeMask only on/off (0x0/0x) and in combination with osg::Node::setUserValue where I was holding my ids (here you can put your layer id for example) I was able to make the combination of which nodes (for you layers) should be on or not. Just an idea Cheers, Nick On Mon, Oct 17, 2016 at 5:24 PM, Davide Raccagniwrote: > Hi Robert, > thank you very much: Group override solves visibility and intersect > problem at once. > > Cheers, > Davide > > -- > Read this topic online here: > http://forum.openscenegraph.org/viewtopic.php?p=69045#69045 > > > > > > ___ > 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] Insersector doesn't take into account DrawableCullCallback result
Hi Robert, thank you very much: Group override solves visibility and intersect problem at once. Cheers, Davide -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69045#69045 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Insersector doesn't take into account DrawableCullCallback result
Hi Davide, On 17 October 2016 at 15:48, Davide Raccagniwrote: > thanks for your quick reply. If I have well understood, the NameMask allow to > define up to 32 masks (32 bit). My problem is that I have an unpredictable > number of layers (in general more than 32): this is the reason why I have > used DrawableCullCallback. As an alternative you suggest to use Switch: in > this case I could define a class that extends Switch class and override > getValue function returning a value in accordance to Layer visibility. What > do you think about? You needn't subclass from osg::Switch, you could just subclass from osg::Group and override the traverse(.) method to provide the decision about whether to traverse the subgraph or not. Another approach is manage the switching on/off at a higher level but use the NodeMask 0x0 or 0x as the two states for whether to rendering or not a subgraph. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Insersector doesn't take into account DrawableCullCallback result
Hi Robert, thanks for your quick reply. If I have well understood, the NameMask allow to define up to 32 masks (32 bit). My problem is that I have an unpredictable number of layers (in general more than 32): this is the reason why I have used DrawableCullCallback. As an alternative you suggest to use Switch: in this case I could define a class that extends Switch class and override getValue function returning a value in accordance to Layer visibility. What do you think about? Thanks in advance Cheers, Davide -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=69041#69041 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Insersector doesn't take into account DrawableCullCallback result
Hi Davide, The Intersectors don't have specific handling of drawable callbacks so I don't think it'll be possible to do it how you want. Personally I wouldn't use DrawableCullCalbacks to toggle on/off drawables from rendering. I'd either use a osg::Switch or a NodeMask that decorates the subgraph that you want to toggle on/on. The NodeMask is pretty light weight and with OSG-3.4 onwards will work with Drawable too, so this is what I'd use. Another advantage of using NodeMask is because it's a built in feature rather than use customization it will work with built in features. You can also use traversal mask in combination with node masks if you want. Robert. On 17 October 2016 at 12:34, Davide Raccagniwrote: > Hello, > I need to define a specific DrawableCullCallback for each Geometry to > hide/show them by using a layer approach like in AutoCAD. I've noticed that > LinearIntersector and PolytopeIntersector don't skip drawable with a > DrawableCullCallback assigned that returns true. Is there a way for the > methods above to take the DrawableCullCallback result into account? > > Thanks in advance. > Davide Raccagni > > ___ > 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
[osg-users] Insersector doesn't take into account DrawableCullCallback result
Hello, I need to define a specific DrawableCullCallback for each Geometry to hide/show them by using a layer approach like in AutoCAD. I've noticed that LinearIntersector and PolytopeIntersector don't skip drawable with a DrawableCullCallback assigned that returns true. Is there a way for the methods above to take the DrawableCullCallback result into account? Thanks in advance. Davide Raccagni ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org