<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<![CDATA[
ecmascript: function initialize () { index = 0; viewpointCount = viewpoints.length; traceEnabled = TraceHolderNode.loop; tracePrint ('initialize: viewpoints.length=' + viewpointCount); tracePrint ('initialize: Viewpoint [' + index + '] ' + viewpoints[index].description); if (TriggerNode.enabled=='false') return; if (viewpointCount > 0) viewpoints[index].set_bind = true; } function set_enabled (newValue, timeStamp) { enabled = newValue; tracePrint ('enabled=' + newValue); if ((newValue == true) && (viewpoints.length >= 1)) viewpoints[0].bind = true; } function triggerNext(triggerTime, timeStamp) { if ((TriggerNode.enabled=='false') || (viewpointCount==0)) return; if (index < viewpointCount - 1) index++; else index = 0; if (viewpointCount > 1) viewpoints[index].set_bind = true; tracePrint ('triggerNext: Viewpoint [' + index + '] ' + viewpoints[index].description); } function previous (value, timeStamp) { if ((TriggerNode.enabled=='false') || (viewpointCount==0)) return; if (value==true) // trigger on true events only { if (index > 0) index--; else index = viewpointCount - 1; if (viewpointCount > 1) viewpoints[index].set_bind = true; tracePrint ('previous: Viewpoint [' + index + '] ' + viewpoints[index].description); } } function next (value, timeStamp) { if ((TriggerNode.enabled=='false') || (viewpointCount==0)) return; if (value==true) // trigger on true events only { if (index < viewpointCount - 1) index++; else index = 0; if (viewpointCount > 1) viewpoints[index].set_bind = true; tracePrint ('next: Viewpoint [' + index + '] ' + viewpoints[index].description); } } function tracePrint(outputString) { if (traceEnabled) Browser.print ('[ViewpointSequencer] ' + outputString + '\n'); } function alwaysPrint(outputString) { Browser.print ('[ViewpointSequencer] ' + outputString + '\n'); }
]]>
<!--
Color key:
<X3dNode
DEF='idName' field='value'/>
matches
<XmlElement
DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
<Prototype
name='ProtoName'>
<field
name='fieldName'/> </Prototype>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->