ParallelGraphics Forums
SDK
You are here: [Forums]::[General]::[SDK]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
Try RobinZone!
email:  password:
   General - SDK

Subject: Re: [remove node] rootnodes/nodes issue
Sender: dan.vera@gmail.com 10.08.07 02:45

Hello Andrea,

I do not know how to remove a node from the scene directly using the SDK. I am not sure this can be done.

I personally do that via a script node that uses the "removeChildren" event of a transform node:

my code looks like this:

DEF a_script Script {    

eventIn SFNode a_node_to_remove
field SFNode my_transform_node IS the_transorm_node

url "javascript:

function remove_node (a_SFnode) {
my_transform.removeChildren = New MFNode(a_SFNode);
}
"}

So if you know the transform node that has the geometry you want to remove, as a child, you can embed a script node in your scene that will handle the children removal. Send the node you want to remove to it.

This is not the simple approach you were hoping for i guess, but that is a solution. Hope this will help.

If you find a better one, let me know!! ;)

Cheers

dan




Hallo everybody,
I'm trying to remove a complex shape from the scenegraph. The shape is contained into a DEF named Transform node. I can easily get the node through the get_Nodes()/get_Item(name), but when I try to remove it the call fails. I read that the get_Nodes collection is read-only, but given that my DEF node is not a root node, how can I retrieve it through a get_RootNodes?

I though something like
1) get DEF node through get_Nodes
2) get parent node
3) get again DEF node through node->get_RootNodes
4) remove it
but I don't know how to get the parent node of a node.

Anyway there must be a simpler approach.
I work on Cortona 4.1/VC++6.

Thanks a million for any hints,
Andrea


 


[remove node] rootnodes/nodes issue / Andrea B / 2.08.07 07:45
     Re: [remove node] rootnodes/nodes issue / dan.vera@gmail.com / 10.08.07 02:45

Messages in thread: 2


© 1998-2007 ParallelGraphics. All rights reserved. Terms of use.