ParallelGraphics Forums
Cortona VRML Client
You are here: [Forums]::[Browsers]::[Cortona VRML Client]

Registration 
Registration
Forgot your password?

Help 
Help
Support

Quick search 

Subscribe to newsletters 

Install Cortona VRML Client for FREE!
Outline 3D
3D Page Of the Week
email:  password:
   Browsers - Cortona VRML Client

Subject: Re: Using dynamically added and def'd objects.
Sender: zhshang@uiah.fi 8.04.02 19:54
well actually there is a solution simply use something like
    string=' Group { children [ ' + node
+ '' etc

Is this suposed to be inside url:"javascript"
before "Browser.creatVRMLfromSTRING(string) "?
do I need to route "string" out to "root.addchildren"
or someother static node.addchildren to make it work?

where node is a SFNode field which USEes
the actual node in the scene.

Also this trick for adding ROUTEs
to/from the main scene from the
dynamically added objects.

1) store the MFNode created by
CreateVrmlFromString in a temporay node.

Can you specify how? just "creatVRMLfromString()"
it will not generate any output as I know--then it is stored in
temp node?

2) have the mainscene node in a SF or MF Node field

Is it already in a MFnode, should we do anything else?

3) use Browser.addRoute(tempNodes [0], 'isActive', Control, 'isActive');

Why even I knew the DEFed nodes name, I still can not get
any result.

Should I route the eventout "string" to something like
root.addchildren ?

Does below anything wrong! Please help me check it
Thanke

#VRML V2.0 utf8
Sound {                          
    minBack 20                
    minFront 20                
    maxBack 50                 
    maxFront 50                 
    source DEF SOUND AudioClip {    
            url "Shoot.wav"        
         }                
    }
DEF GROUP Transform {
}
DEF CREATOR Script {
eventOut MFNode newChildren
directOutput TRUE
url "javascript:
function initialize() {
newVRML = '    Group { children [';
newVRML += '         DEF SENSOR TouchSensor {}';
newVRML += ' Shape {                 ';
newVRML += ' geometry Box {                 ';
newVRML += ' size .7 .2 .7                  ';
newVRML += ' }                 ';
newVRML += ' }     ] }                 ';
newChildren = Browser.createVrmlFromString(newVRML);
Browser.addRoute(SENSOR,'touchTime',SOUND,'startTim
e');
}"
ROUTE CREATOR.newChildren TO GROUP.addChildren

 


Re: Using dynamically added and def'd objects. / zhshang@uiah.fi / 8.04.02 19:54
     Re: Using dynamically added and def'd objects. / fabricatorgeneral@yahoo.com / 10.04.02 15:10
         Re: Using dynamically added and def'd objects. / zhshang@uiah.fi / 10.04.02 19:57

Messages in thread: 3


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