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 

Show children with hidden parent


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


Joined: 31 Mar 2017
Posts: 20

PostPosted: Wed Apr 26, 2017 6:11 am    Post subject:
Show children with hidden parent
Reply with quote

Hi,

How can I hide parent only? Children must stay visible. I tried to do it by setting zero nodemask to parent - it hides with children.

Thank you!

Cheers,
Yura
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10892

PostPosted: Wed Apr 26, 2017 7:59 am    Post subject:
Show children with hidden parent
Reply with quote

Hi Yura,

The scene graph state works top down, so parent state affects the
children. If you set parents NodeMask to 0 then it's children will
not be traversed. This is fundamental to the design of the OSG and
one of it's great strengths.

The real question I'd have is what you mean by hiding the parent as
it's only leaf nodes that contain osg::Geometry/Drawble that can be
rendered, internal nodes of the scene graph can't ever be seen
themselves graphically. Given this is really hard to know what you
mean, as it doesn't make any sense in the context of how the OSG
works.

Could you take a step back and describe what you are trying to achieve
rather than how you are trying to achieve it, a higher level
explanation will enable us how you should try and achieve it.

Robert.

On 26 April 2017 at 07:11, Yura Ivanov <> wrote:
Quote:
Hi,

How can I hide parent only? Children must stay visible. I tried to do it by setting zero nodemask to parent - it hides with children.

Thank you!

Cheers,
Yura

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








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


Joined: 31 Mar 2017
Posts: 20

PostPosted: Thu Apr 27, 2017 5:58 am    Post subject:
Reply with quote

Hi,

We have scene with a lot of objects (1_Scene.png). Objects that have same name are instances of one object. Instances differ by transform. The count of instances of the same object can be up to 1000. User at a single time must see:
1) all instances of one object (2_C_only.png, 4_F_only.png), or
2) all instances of one object and it's direct children only (3_C_and_1st_level.png).

Children should inherit transform from their parent
Setting color to object should not apply to it's children.

Thank you!

Cheers,
Yura
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10892

PostPosted: Thu Apr 27, 2017 9:39 am    Post subject:
Show children with hidden parent
Reply with quote

Hi Yura,

Thanks for the explanation. I'm not entirely clear on what you are
after, so will provide some general comments.

First up, in the OSG a parent node is always traversed before
children, so if you stop traversal at a parent none of the children
will be traversed. So if you set the NodeMask of the parent ot 0 then
non of the children will be traversed. So you can't use this to
achieve the result you want.

The osg::Node's NodeMask is a 32bit mask which is and'd against the
NodeVisitor's TraversalMask, for the cull traversal this TraversalMask
is set by the View(er)'s Camera's(inherited from osg::CullSettings)
setCullMask().

If the classes of objects you have are limited to 32 different
components then it might be possible to use the NodeMask to toggle
on/off different subgraphs by changing the CullMask. For insrtance
your A, B, C, D etc. classifications could each be mapped to a
separate bit, then your CullMask would set the appropriate bit you
want to see at one time. If possible to use this approach it's really
lightweight and utilizes standard OSG features.

Another approach is to use osg::Switch to toggle on/off different subgrahs.

Another approach is to use a custom osg::Group or NodeCallback that
overrides the traverse implementation and makes it's own judgement on
whether to traverse the children or not. For instance you might have
some global state that tells you want parts you want to see, and this
could global state could be shared between the callbacks/Nodes.

Robert.


On 27 April 2017 at 06:58, Yura Ivanov <> wrote:
Quote:
Hi,

We have scene with a lot of objects (1_Scene.png). Objects that have same name are instances of one object. Instances differ by transform. The count of instances of the same object can be up to 1000. User at a single time must see:
1) all instances of one object (2_C_only.png, 4_F_only.png), or
2) all instances of one object and it's direct children only (3_C_and_1st_level.png).


Thank you!

Cheers,
Yura[/img]

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








------------------
Post generated by Mail2Forum
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 NodeCallback does not traverse children YuraIU02 General 3 Mon Apr 10, 2017 8:43 am View latest post
No new posts Attaching children to the prerender c... Mary-Ann General 5 Mon Sep 19, 2016 3:13 pm View latest post
No new posts Best way to cull object hidden by a m... kragnfroll General 18 Wed Jun 22, 2016 3:55 pm View latest post
No new posts Remove all LOD children Bruno Oliveira General 7 Fri May 13, 2016 1:55 pm View latest post
No new posts Show loading info on osgQt::QWebViewI... Héctor Martínez General 0 Thu Nov 05, 2015 8:31 am 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