Skip to content

Instantly share code, notes, and snippets.

@cecilemuller
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cecilemuller/7843bae1e75ffe83cb2e to your computer and use it in GitHub Desktop.
Save cecilemuller/7843bae1e75ffe83cb2e to your computer and use it in GitHub Desktop.
Script inside a X3D scene
<?xml version="1.0" encoding="UTF-8"?>
<X3D profile="Immersive" version="3.0">
<Scene>
<OrientationInterpolator DEF="interp" key='0,0.5,1' keyValue='0 1 0 0.5,0 1 0 0.8,0 1 0 1.2'></OrientationInterpolator>
<Script>
<field accessType="initializeOnly" name="interp" type="SFNode">
<OrientationInterpolator USE="interp"/>
</field>
<![CDATA[ javascript:
function initialize(){
Browser.showConsole();
var now = Browser.getTime();
trace('The time is: ' + now);
// Says the value is 0 1 0 0.5
trace('(before) The first rotation is: ' + interp.keyValue[0]);
// Changes the angle of the first rotation
interp.keyValue[0][3] = 3.14;
// Says the value is 0 1 0 3.14
trace('(after) The first rotation is now: ' + interp.keyValue[0]);
}
]]>
</Script>
</Scene>
</X3D>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment