OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Selective ClipNode


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Ale
User


Joined: 26 Nov 2012
Posts: 37

PostPosted: Tue Apr 18, 2017 10:38 am    Post subject:
Selective ClipNode
Reply with quote

Hi,

in my scene graph I have a root node of type osg::ClipNode.
In this way I can add easily clipping planes to my scene. This works fine.

Now I would like to exclude some nodes from clipping. I wonder if ClipNode supports something like a visitor mask to selectively apply clipping to children.

Thank you in advance.

Best regards
Ale
Back to top
View user's profile Send private message
SMesserschmidt (Sebastian Messerschmidt)
Forum Moderator


Joined: 10 Sep 2013
Posts: 725

PostPosted: Tue Apr 18, 2017 10:41 am    Post subject:
Selective ClipNode
Reply with quote

Hi Ale,
Quote:

in my scene graph I have a root node of type osg::ClipNode.
In this way I can add easily clipping planes to my scene. This works fine.

Now I would like to exclude some nodes from clipping. I wonder if ClipNode supports something like a visitor mask to selectively apply clipping to children.
You can always put the nodes to be excluded from clipping into a
sibling-group of the ClipNode.

Cheers
Sebastian
Quote:

Thank you in advance.

Best regards
Ale

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









------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Ale
User


Joined: 26 Nov 2012
Posts: 37

PostPosted: Tue Apr 18, 2017 12:17 pm    Post subject:
Reply with quote

Hi Sebastian,

I would like to avoid that becouse each node may have complex (dynamic) transformations so I should traverse the scene, calculate the global transformation for each node and update each transformation for the children of the sibling-group

Ale
Back to top
View user's profile Send private message
SMesserschmidt (Sebastian Messerschmidt)
Forum Moderator


Joined: 10 Sep 2013
Posts: 725

PostPosted: Tue Apr 18, 2017 1:01 pm    Post subject:
Selective ClipNode
Reply with quote

Am 4/18/2017 um 2:17 PM schrieb Ale Maro:
Quote:
Hi Sebastian,

I would like to avoid that becouse each node may have complex (dynamic) transformations so I should traverse the scene, calculate the global transformation for each node and update each transformation for the children of the sibling-group
Sorry I don't understand what you mean. If you simply put (at the top
level) parts like this:

SCENE
|-CLIP
|-Childs
|-NON_CLIP
|-Childs

the childs in this example can have arbitary transformations...
If you cannot place your nodes like this, you can take a look at the
ClipNode-implementation and maybe inherit and change the parts that
control the clipping state to set it effectively per child somehow.

The other option is to simply use a shader that implements the clipping
and to switch it on/off via uniform.

Cheers
Sebastian


Quote:

Ale

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









------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Ale
User


Joined: 26 Nov 2012
Posts: 37

PostPosted: Tue Apr 18, 2017 3:59 pm    Post subject:
Reply with quote

Thank you Sebastian,

I also found another way that is useful in my case.
I simply call the following code for each node I want to exclude from clipping:

node->getOrCreateStateSet()->setMode(GL_CLIP_PLANE0, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED);

Ale
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts ClipNode Opposite Behavior ehensens General 13 Wed Jul 22, 2015 7:28 pm View latest post
No new posts Re: a bug with clipnode? ttaw General 0 Thu Jun 12, 2014 8:40 pm View latest post
No new posts a bug with clipnode? ttaw General 2 Thu Jun 12, 2014 10:25 am View latest post
No new posts Fix cut-n-paste errors in ClipNode he... Paul Martz Submission 1 Fri Jan 20, 2012 5:26 pm View latest post
No new posts osg::Manipulator TabBoxDragger and Cl... Andrea74 General 1 Tue Dec 13, 2011 6:12 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP