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: Script node creation
Sender: nalex@parallelgraphics.com 30.10.07 10:02
Hi everybody, I want to create a Script node from the string:

CString StringObjects::script = L"DEF SCRIPT    \                Script {\                eventIn SFBool play \                 field SFNode avatarTimer USE
    AVATARTIMER
         url    [\"javascript: \
            function play(value, time){\
             avatarTimer.set_startTime = time -
    1;\
            }\" ]\
        }";
with CreateNodeFromString function but it fails because of
"field SFNode avatarTimer USE AVATARTIMER".
Can somebody tell me what can I use instead "USE".

You can't do it that way. Try the following:
1) Set the initial value of SFNode field to NULL (in the string with VRML syntax).
2) Create a script node from the syntax.
3) Get "AVATARTIMER" INodeObject from Nodes collection by name.
4) Set the value of the avatarTimer field of the newborn node to INodeObject from 3)
5) Add script node to the scene graph (for example using Add method of the RootNodes collection)

 


Script node creation / mutafchiev@gmx.de / 29.10.07 12:21
     Re: Script node creation / nalex@parallelgraphics.com / 30.10.07 10:02

Messages in thread: 2


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