<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.1//EN" "http://www.web3d.org/specifications/x3d-3.1.dtd"><X3D profile='Immersive' version='3.1' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation=' http://www.web3d.org/specifications/x3d-3.1.xsd '>
<![CDATA[
ecmascript:
// The function angle() receives the currently interpolated rotation angle,
// and then computes the position and orientation of each of the cones.
function angle (value)
{
positionRed = new SFVec3f (Math.cos (value), 1.5 * Math.sin(value), .5);
positionGreen = new SFVec3f (Math.cos (value+2.094), 1.5 * Math.sin(value+2.094), 0);
positionTurquoise = new SFVec3f (Math.cos (value+4.189), 1.5 * Math.sin(value+4.189), -.5);
// The values 2.094 and 4.189 are 1/3 and 2/3 of 2*pi radians.
orientationRed = new SFRotation (0, 0, 1, -2*value);
orientationGreen = new SFRotation (0, 0, 1, -2*(value+2.094));
orientationTurquoise = new SFRotation (0, 0, 1, -2*(value+4.189));
}
]]>
<!-- Tag color codes: <Node DEF='idName' attribute='value'/> -->