X3D Example Archives: X3D4WA, X3D for Web Authors, Chapter 09 Event Utilities Scripting

IntegerSequencer example:  Road Work Ahead!

Event-utility nodes allow conversion and connection of different data types via ROUTEs, while Script nodes allow authors to write their own event-handling code for special scene capabilities.

Event utility nodes simplify data-type conversion of events when producing animation chains between nodes. These include BooleanFilter, BooleanSequencer, BooleanToggle, IntegerSequencer, IntegerTrigger, and TimeTrigger nodes.

The Script node allows authors to define new functionality produced by JavaScript (ECMAscript) or Java code. Authors can add field declarations that define accessType (inputOnly, outputOnly, initializeOnly and inputOutput) and type for each field.

The supporting Chapter 9 slideset and course videos (NPS, YouTube) for X3D for Web Authors are available online via X3dGraphics.com.

Also available: X3D Scene Authoring Hints for Scripts and URL Links.

Authors can use a 10-step algorithm checklist (with example diagram) as an event-animation design pattern that helps build consistent event-routing chains. The supporting Chapter 7 slideset and course videos (NPS, YouTube) for X3D for Web Authors are available online via X3dGraphics.com.

The quick-reference sheet X3D Event Utility Nodes: Field Event Diagrams illustrates the functionality of the event utility nodes. These nodes receive and pass values that are sent via ROUTE connections.

  28 X3D Models       X3D Model Descriptions
   BackgroundColorArrayAnimation BackgroundColorArrayAnimation Design pattern demonstrating type conversion from single SFColor value (sent from a ColorInterpolator node) to an MFColor array (in a Background node).
   BooleanFilterPumpHouse BooleanFilterPumpHouse A BooleanFilter node starts the animation of cones orbiting near the pump house, instead of an unfiltered TouchSensor toggling the animation on/off during selection/deselection.
   BooleanSequencerIntegerSequencer BooleanSequencerIntegerSequencer Show synchronized use of BooleanSequencer and IntegerSequencer nodes for SpotLight enabled and Switch whichChoice control, respectively
   BooleanSequencerPumpHouse BooleanSequencerPumpHouse A BooleanSequencer node intermittently interrupts animation of the pump house.
   BooleanToggleExample BooleanToggleExample A BooleanToggle button determines whether an animated Cone is jittery or not.
   BooleanTogglePumpHouse BooleanTogglePumpHouse A BooleanToggle node controls pump house animation: select to stop, then select again to restart.
   BooleanTriggerPumpHouse BooleanTriggerPumpHouse A BooleanTrigger node initiates the pump house animation: select to start. This model shows a positive-displacement cylinder pump to emulate breakers surge, designed and built by David Packard.
   CircleLinesExample CircleLinesExample Example circle and cross-hairs made out of line segments, autogenerated by a simple Java program.
   CircleLinesExample60 CircleLinesExample60 Example circle and cross-hairs made out of line segments, autogenerated by a simple Java program.
   CircleLinesSphereLatitude CircleLinesSphereLatitude Build a sphere outline by using multiple CircleLine circles as latitude rings, with actual semitransparent Sphere and axes added as a visualization hint.
   CircleLinesSphereLongitude CircleLinesSphereLongitude Build a sphere outline by using multiple CircleLine circles as longitude rings, with actual semitransparent Sphere and axes added as a visualization hint.
   ElevationGridSimpleWaveAnimation ElevationGridSimpleWaveAnimation Simple Javascript animation of ElevationGrid
   IntegerSequencerPumpHouse IntegerSequencerPumpHouse An IntegerSequencer node switches the display of colored cones near the pump house.
   IntegerSequencerRoadSignSwitcher IntegerSequencerRoadSignSwitcher Switch among different road signs using IntegerSequencer
   IntegerTriggerExample An IntegerTrigger node controls the display of colored text.
   IntegerTriggerPumpHouse IntegerTriggerPumpHouse An IntegerTrigger node controls the display of colored cones near the pump house.
   MoodSelector MoodSelector Design pattern demonstrating multiple TouchSensor, IntegerTrigger, Shape and ROUTE combinations for selecting a Switch
   newECMAscriptTest newECMAscriptTest Example scene providing a unit test for newECMAscript template javascript source code, first load this scene and then see console for test output.
   ScriptComplexStateEvents ScriptComplexStateEvents A lamp with 4 intensities (off low medium high) and a push-button switcher, all controlled by a Script node.
   ScriptControlEvents ScriptControlEvents A three-way light controlled by a Script node.
   ScriptEvents ScriptEvents A Script node drives the position and orientation of orbiting cones near the pump house.
   ScriptEventsPumpHouse ScriptEventsPumpHouse A Script node provides the path and orientation animation for three cones that orbit near the pump house.
   ScriptNodeEventOutControlEcmaScript ScriptNodeEventOutControlEcmaScript Script node interface between X3D and EcmaScript: this conformance example tests event-based X3D-EcmaScript functionality.
   ScriptNodeFieldControlEcmaScript ScriptNodeFieldControlEcmaScript Script node interface between X3D and EcmaScript: this conformance example tests field-based X3D-EcmaScript functionality.
   ScriptSimpleStateEvents ScriptSimpleStateEvents A Script node drives an animated push button that turns a light on and off.
   TestScriptInitialization TestScriptInitialization Test ability to perform Script initialize() method using ECMAsript
   TimeTriggerPumpHouse TimeTriggerPumpHouse Pump house animation activated by a TimeTrigger node.
   TimeTriggerTest TimeTriggerTest Test of TimeTrigger node.

The X3D Resources: Examples page and X3D Developers Guide provide more information about the production of this archive.