Last active
August 29, 2015 14:03
-
-
Save cecilemuller/7843bae1e75ffe83cb2e to your computer and use it in GitHub Desktop.
Script inside a X3D scene
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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