<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<![CDATA[
ecmascript: function initialize () { newColor = diffuseColor; // start with original color } function clockTrigger (timeValue) { if (!enabled) return; red = newColor.r; green = newColor.g; blue = newColor.b; // note different modulation rates for each color component, % is modulus operator newColor = new SFColor ((red + 0.02) % 1, (green + 0.03) % 1, (blue + 0.04) % 1); if (enabled) { Browser.println ('diffuseColor=(' + red +',' + green + ',' + blue + ') newColor=' + newColor.toString()); } } function set_enabled (newValue) { enabled = newValue; }
]]>
Event Graph ROUTE Table entries with 4 ROUTE connections total, showing X3D event-model relationships for this scene.
Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.
TouchTextInterface
TouchSensor isActive SFBool |
EventToggler
BooleanToggle set_boolean SFBool |
then |
EventToggler
BooleanToggle toggle SFBool |
MaterialModulatorInstance
ProtoInstance enabled SFBool |
ModulationClock
TimeSensor cycleTime SFTime |
MaterialModulatorScript
Script clockTrigger SFTime |
then |
MaterialModulatorScript
Script newColor SFColor |
MaterialNode
Material diffuseColor SFColor |
MaterialModulatorScript
Script newColor SFColor |
MaterialNode
Material diffuseColor SFColor |
MaterialModulatorInstance
ProtoInstance MaterialModulator |
No ROUTE connection found for output from this node. Contains SFNode/MFNode field with indirect access to other nodes. |
<!--
Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html
-->
<!--
Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulator.x3d
-->
<!--
Color legend: X3D terminology
<X3dNode
DEF='idName' field='value'/>
matches XML terminology
<XmlElement
DEF='idName' attribute='value'/>
(Light-blue background: event-based behavior node or statement)
(Grey background inside box: inserted documentation)
(Magenta background: X3D Extensibility)
<ProtoInstance
name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->