This is Interesting: Free Magazines for Graphics designers and webmasters  


Home > Archive > VRML > October 2005 > proto eventout reference to self





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author proto eventout reference to self
Steve Smith

2005-10-20, 6:26 am

Does anyone know a way of creating a proto SFnode eventOut which is a
reference to itself.

Thanks

Steve


fabricator

2005-10-22, 6:24 pm

Simplier way of doing this, which doesn't create recursion by the way.

Add a field like this to the PROTO:
SFInt32 id 0
You need use unique value for each instance

then have the PROTO send that value as an eventOut, you can then read
the list of proto instances to find the one using that id.

Another way would be to use MFInt32 and have the contents represent the
exact location of the node in the scene graph.
For example:[ 0 1 3]
would be: node=scene.children[0].children[1].children[3];

good luck
Paul
http://www.vrmlworlds.com/

Steve Smith

2005-10-23, 6:20 pm

Thanks Paul,
It did it your way and it worked fine.
S

"fabricator" <fabricatorgeneral@yahoo.com> wrote in message
news:1129989020.840290.261130@g44g2000cwa.googlegroups.com...
> Simplier way of doing this, which doesn't create recursion by the way.
>
> Add a field like this to the PROTO:
> SFInt32 id 0
> You need use unique value for each instance
>
> then have the PROTO send that value as an eventOut, you can then read
> the list of proto instances to find the one using that id.
>
> Another way would be to use MFInt32 and have the contents represent the
> exact location of the node in the scene graph.
> For example:[ 0 1 3]
> would be: node=scene.children[0].children[1].children[3];
>
> good luck
> Paul
> http://www.vrmlworlds.com/
>



Sponsored Links


Copyright 2003 - 2008 forum4designers.com  Software forum  Computer Hardware reviews