Table of Contents Previous Directory Summary Directory Viewpoint Slideshow Javadoc for translated java source Next Directory Summary X3D Resources

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 Background Color Array Animation Design pattern demonstrating type conversion from single SFColor value (sent from a ColorInterpolator node) to an MFColor array (in a Background node).
BooleanFilterPumpHouse Boolean Filter Pump House 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 Boolean Sequencer Integer Sequencer Show synchronized use of BooleanSequencer and IntegerSequencer nodes for SpotLight enabled and Switch whichChoice control, respectively
BooleanSequencerPumpHouse Boolean Sequencer Pump House A BooleanSequencer node intermittently interrupts animation of the pump house.
BooleanToggleExample Boolean Toggle Example A BooleanToggle button determines whether an animated Cone is jittery or not.
BooleanTogglePumpHouse Boolean Toggle Pump House A BooleanToggle node controls pump house animation: select to stop, then select again to restart.
BooleanTriggerPumpHouse Boolean Trigger Pump House 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 Circle Lines Example Example circle and cross-hairs made out of line segments, autogenerated by a simple Java program.
CircleLinesExample60 Circle Lines Example 60 Example circle and cross-hairs made out of line segments, autogenerated by a simple Java program.
CircleLinesSphereLatitude Circle Lines Sphere Latitude Build a sphere outline by using multiple CircleLine circles as latitude rings, with actual semitransparent Sphere and axes added as a visualization hint.
CircleLinesSphereLongitude Circle Lines Sphere Longitude Build a sphere outline by using multiple CircleLine circles as longitude rings, with actual semitransparent Sphere and axes added as a visualization hint.
ElevationGridSimpleWaveAnimation Elevation Grid Simple Wave Animation Simple Javascript animation of ElevationGrid
IntegerSequencerPumpHouse Integer Sequencer Pump House An IntegerSequencer node switches the display of colored cones near the pump house.
IntegerSequencerRoadSignSwitcher Integer Sequencer Road Sign Switcher Switch among different road signs using IntegerSequencer
Integer Trigger Example An IntegerTrigger node controls the display of colored text.
IntegerTriggerPumpHouse Integer Trigger Pump House An IntegerTrigger node controls the display of colored cones near the pump house.
MoodSelector Mood Selector Design pattern demonstrating multiple TouchSensor, IntegerTrigger, Shape and ROUTE combinations for selecting a Switch
newECMAscriptTest new ECMAscript Test Example scene providing a unit test for newECMAscript template javascript source code, first load this scene and then see console for test output.
ScriptComplexStateEvents Script Complex State Events A lamp with 4 intensities (off low medium high) and a push-button switcher, all controlled by a Script node.
ScriptControlEvents Script Control Events A three-way light controlled by a Script node.
ScriptEvents Script Events A Script node drives the position and orientation of orbiting cones near the pump house.
ScriptEventsPumpHouse Script Events Pump House A Script node provides the path and orientation animation for three cones that orbit near the pump house.
ScriptNodeEventOutControlEcmaScript Script Node Event Out Control Ecma Script Script node interface between X3D and EcmaScript: this conformance example tests event-based X3D-EcmaScript functionality.
ScriptNodeFieldControlEcmaScript Script Node Field Control Ecma Script Script node interface between X3D and EcmaScript: this conformance example tests field-based X3D-EcmaScript functionality.
ScriptSimpleStateEvents Script Simple State Events A Script node drives an animated push button that turns a light on and off.
TestScriptInitialization Test Script Initialization Test ability to perform Script initialize() method using ECMAsript
TimeTriggerPumpHouse Time Trigger Pump House Pump house animation activated by a TimeTrigger node.
TimeTriggerTest Time Trigger Test Test of TimeTrigger node.

Online at https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting

Validate XHTML 1.1

Master source-code model archive is under subversion control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting

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

Table of Contents Previous Directory Summary Directory Viewpoint Slideshow Javadoc for translated java source Next Directory Summary X3D Resources