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

doug sanden highaspirations at hotmail.com
Wed May 28 07:05:58 PDT 2014

Yes. 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 enginefunction 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);..-Doug

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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20140528/17a43167/attachment.html>

More information about the X3D-Public mailing list