[X3D-Public] variable in ecma script SFVec3F parrameter?

Sven-Erik Tiberg Sven-Erik.Tiberg at ltu.se
Wed May 28 13:02:36 PDT 2014

Thanks Doug

It's my old idea to form a group of X3D sceens into a X3Dspace and syncronize the sceen node states  over the internet using XMPP with the JScripting lib strophe. Would also like to incorporate simulations engines in the X3DSpace.

To understand the X3D with Ecma scripting and hopefully merge it with xmpp based inter browser communication are a step in that direction.


From: X3D-Public <x3d-public-bounces at web3d.org> on behalf of doug sanden <highaspirations at hotmail.com>
Sent: Wednesday, May 28, 2014 4:05 PM
To: x3d-public at web3d.org
Subject: Re: [X3D-Public] variable in ecma script SFVec3F parrameter?

var z = -1;
changedPosition = new SFVec3f(0,-1,z);
If you want to 'save state' between functions, there are 2 ways to do it:
a) above the script functions:
var z = -1;  //not all browsers support this, I suspect it depends on the javascript engine
function initialize()
changedPosition = new SFVec3f(0,-1,z);
z = z - 1; //for fun, have the text fade on each click
b) another Script node field:
<field name='y' type='SFFloat' accessType='inputOutput' value='2.0'/>
changedPosition = new SFVec3f(0,y+1,z);

From: Sven-Erik.Tiberg at ltu.se
To: x3d-public at web3d.org
Date: Wed, 28 May 2014 13:10:38 +0000
Subject: [X3D-Public] variable in ecma script SFVec3F parrameter?


In example  http://www.web3d.org/x3d/content/examples/Basic/ScriptConformance/_pages/page09.html


case 2: // post-click all-done message


               changedPosition = new SFVec3f ( 0, -1, 0 );


Are therer any restrictions in using changedPosition( myVarX, myVarY, myVarZ ); Where MyVarX are a normal variable that can be changed in the script?

/Sven-Erik Tiberg

_______________________________________________ X3D-Public mailing list X3D-Public at web3d.org http://web3d.org/mailman/listinfo/x3d-public_web3d.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20140528/86448a90/attachment.html>

More information about the X3D-Public mailing list