<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns:ds="http://www.w3.org/2000/09/xmldsig#" xmlns:saxon="http://icl.com/saxon"
      xmlns="http://www.w3.org/TR/xhtml1/strict">
   <head>
      <title>MaterialModulator.x3d (X3dToXhtml listing)</title>
      <!-- I18N -->
<meta http-equiv="X-UA-Compatible" content="chrome=1,IE=edge"/>
      <meta http-equiv="Content-Type" content="text/html;charset=UTF-8"/>
      <style type="text/css">
span.element {color: navy}
span.attribute {color: green}
span.value {color: teal}
span.plain {color: black}
span.gray  {color: gray}
span.idName {color: maroon}
a.idName {color: maroon}
div.center {text-align: center}
div.indent {margin-left: 25px}

span.prototype {color: purple}
a.prototype {color: purple}
a.prototype:visited {color: black}
span.route {color: red}
b.warning {color: #CC5500}
b.error {color: #CC0000}

                </style>
      <style type="text/css">
table.curvedEdges { border:10px solid RoyalBlue;-webkit-border-radius:13px;-moz-border-radius:13px;-ms-border-radius:13px;-o-border-radius:13px;border-radius:13px; }
table.curvedEdges td, table.curvedEdges th { border-bottom:1px dotted black;padding:5px; }
</style>
      <meta name="generator" content="XSLT processor SAXON 9.1.0.2 from Saxonica"/>
      <meta name="generator" content="http://www.web3d.org/x3d/stylesheets/X3dToXhtml.xslt"/>
      <meta name="generator"
            content="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToXhtml.xslt"/>
      <link rel="shortcut icon"
            href="http://www.web3d.org/x3d/content/icons/X3DtextIcon16.png"
            title="X3D"/>
   </head>
   <body>
      <code title="XML declaration"><?xml version="1.0" encoding="UTF-8"?></code>
      <br/>
      <code title="Document Type Declaration (DTD) for X3D validation"><!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "<a href="http://www.web3d.org/specifications/x3d-3.3.dtd">http://www.web3d.org/specifications/x3d-3.3.dtd</a>"></code>
      <div>
<span title="X3D is the top-most XML element for an Extensible 3D (X3D) Graphics file"><<span class="element">X3D</span> <span title="X3D Immersive Profile supports most nodes, similar to VRML97"><span class="attribute">profile</span>='<span class="value">Immersive</span>'</span> <span class="attribute">version</span>='<span class="value">3.3</span>' <span title="XML namespace for X3D Graphics schema validation"><span title="XML namespace for XML Schema validation">
            <span class="attribute">xmlns:xsd</span>='<a href="http://www.w3.org/2001/XMLSchema-instance" target="_blank">http://www.w3.org/2001/XMLSchema-instance</a>'
</span>
         <span title="XML namespace for X3D Graphics schema validation">
            <span class="attribute">xsd:noNamespaceSchemaLocation</span>
         </span>='
<a href="http://www.web3d.org/specifications/x3d-3.3.xsd">http://www.web3d.org/specifications/x3d-3.3.xsd</a>
'</span>>
</span><div class="indent">
<span title="head can contain component, unit, and author-defined metadata (meta) tags"><<span class="element">head</span>>
</span><div class="indent">
<span title="meta 'title' provides file name for this resource"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">title</span>' <span class="attribute">content</span>='<a href="MaterialModulator.x3d">MaterialModulator.x3d</a>'/>
</span><br />

<span title="meta 'description' provides summary overview describing this resource"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">description</span>' <span class="attribute">content</span>='<span class="plain">Mimic a Material node and modulate fields as an animation effect</span>'/>
</span><br />

<span title="meta 'hint' provides a user hint about resource features or operation"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">hint</span>' <span class="attribute">content</span>='<span class="value">try changing the modulation script so that it goes from [0 ... 1] and then [1 ... 0] alternating, rather than abruptly shifting from 1 immediately back to 0.</span>'/>
</span><br />

<span title="meta 'creator' provides name of original author"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">creator</span>' <span class="attribute">content</span>='<span class="value">Don Brutzman</span>'/>
</span><br />

<span title="meta 'created' provides date of initial version"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">created</span>' <span class="attribute">content</span>='<span class="value">10 March 2008</span>'/>
</span><br />

<span title="meta 'modified' provides date of modified version"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">modified</span>' <span class="attribute">content</span>='<span class="value">28 November 2014</span>'/>
</span><br />

<span title="meta 'subject' provides search-index subject keywords, key phrases, or classification codes"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">subject</span>' <span class="attribute">content</span>='<span class="value">X3D prototype requiring Script inputOutput fields</span>'/>
</span><br />

<span title="meta 'image' provides name or reference link to a supporting image file"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">Image</span>' <span class="attribute">content</span>='<a href="MaterialModulator.png">MaterialModulator.png</a>'/>
</span><br />

<span title="meta 'identifier' provides the unique Uniform Resource Identifier (URI) or url address for this resource"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">identifier</span>' <span class="attribute">content</span>='
<a href="http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14-Prototypes/MaterialModulator.x3d">http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14-Prototypes/MaterialModulator.x3d</a>
'/>
</span><br />

<span title="meta 'generator' provides name of authoring tool or translation tool producing this scene"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">generator</span>' <span class="attribute">content</span>='<span class="value">X3D-Edit 3.3, </span>
               <a href="https://savage.nps.edu/X3D-Edit" target="_blank">https://savage.nps.edu/X3D-Edit</a>'/>
</span><br />

<span title="meta 'license' provides software license link or information"><<span class="element">meta</span> <span class="attribute">name</span>='<span class="value">license</span>' <span class="attribute">content</span>='
<a href="../license.html">../license.html</a>'/>
</span></div><span title="head can contain component, unit, and author-defined metadata (meta) tags"></<span class="element">head</span>>
</span><br /><span style="color:white">
<!--
</span>
            <div class="center">
               <hr style="width:100%"/>
               <b>
                  <i>Index for ProtoDeclare definition</i>
               </b>: 
<a title="go to this declaration" href="#ProtoDeclare_MaterialModulator"
                  class="prototype">MaterialModulator</a>
<br /><hr width="50%"/>
               <b>
                  <i>Index for DEF nodes</i>
               </b>: 
<a title="go to this BooleanToggle node" href="#EventToggler" class="idName">EventToggler</a>,
<a title="go to this ProtoInstance node" href="#MaterialModulatorInstance"
                  class="idName">MaterialModulatorInstance</a>,
<a title="go to this Script node" href="#MaterialModulatorScript" class="idName">MaterialModulatorScript</a>,
<a title="go to this Material node" href="#MaterialNode" class="idName">MaterialNode</a>,
<a title="go to this TimeSensor node" href="#ModulationClock" class="idName">ModulationClock</a>,
<a title="go to this TouchSensor node" href="#TouchTextInterface" class="idName">TouchTextInterface</a>
               <hr style="width:100%"/>
            </div>
            <span style="color:white">
-->
</span><br />

<span title="Scene is the root node that contains an X3D scene graph"><<span class="element">Scene</span>>
</span><div class="indent">
               <a name="ProtoDeclare_MaterialModulator"> </a> 
<span title="ProtoDeclare is a Prototype declaration, defining a new node made up of other node(s)"><<span class="prototype">ProtoDeclare</span> <span class="attribute">name</span>='<span class="prototype">MaterialModulator</span>' <span title="application information for this ProtoDeclare"><span class="gray">appinfo</span>='<span class="value">mimic a Material node and modulate fields as an animation effect</span>'</span>>
</span><div class="indent">
<<span class="prototype">ProtoInterface</span>>
<div class="indent">
                     <a name="MaterialModulatorProtoField_enabled"> </a> 
<span title="A field element defines an interface attribute or node"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">enabled</span>' <span class="attribute">type</span>='<span class="value">SFBool</span>' <span class="attribute">value</span>='<span class="value">true</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span><br />
<a name="MaterialModulatorProtoField_diffuseColor"> </a> 
<span title="A field element defines an interface attribute or node"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">diffuseColor</span>' <span class="attribute">type</span>='<span class="value">SFColor</span>' <span class="attribute">value</span>='<span class="value">0.8 0.8 0.8</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span><br />
<a name="MaterialModulatorProtoField_emissiveColor"> </a> 
<span title="A field element defines an interface attribute or node"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">emissiveColor</span>' <span class="attribute">type</span>='<span class="value">SFColor</span>' <span class="attribute">value</span>='<span class="value">0 0 0</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span><br />
<a name="MaterialModulatorProtoField_specularColor"> </a> 
<span title="A field element defines an interface attribute or node"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">specularColor</span>' <span class="attribute">type</span>='<span class="value">SFColor</span>' <span class="attribute">value</span>='<span class="value">0 0 0</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span><br />
<a name="MaterialModulatorProtoField_transparency"> </a> 
<span title="A field element defines an interface attribute or node"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">transparency</span>' <span class="attribute">type</span>='<span class="value">SFFloat</span>' <span class="attribute">value</span>='<span class="value">0.0</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span><br />
<a name="MaterialModulatorProtoField_shininess"> </a> 
<span title="A field element defines an interface attribute or node"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">shininess</span>' <span class="attribute">type</span>='<span class="value">SFFloat</span>' <span class="attribute">value</span>='<span class="value">0.2</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span><br />
<a name="MaterialModulatorProtoField_ambientIntensity"> </a> 
<span title="A field element defines an interface attribute or node"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">ambientIntensity</span>' <span class="attribute">type</span>='<span class="value">SFFloat</span>' <span class="attribute">value</span>='<span class="value">0.2</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span></div></<span class="prototype">ProtoInterface</span>>
<br />

<<span class="prototype">ProtoBody</span>>
<div class="indent">
                     <a name="MaterialNode"> </a> 
<!-- <span class="idName">MaterialNode</span> <i>ROUTE</i>: 
[<a title="go to this ROUTE" href="#ROUTE_0"><i>from</i> <span class="idName">MaterialModulatorScript</span>.<span class="attribute">newColor</span> <i>to</i> <span class="attribute">diffuseColor</span>
                     </a>]
 --><br />
<span title="Material specifies surface rendering properties for associated geometry"><<span class="element">Material</span> <span class="attribute">DEF</span>='<span class="idName" title="DEF name is a unique ID for a given node">MaterialNode</span>'>
</span><div class="indent">
<span title="IS connects ProtoDeclare interface fields to node fields inside ProtoDeclare definitions"><<span class="element">IS</span>>
</span><div class="indent">
<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">diffuseColor</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_diffuseColor"
                                 class="prototype">diffuseColor</a></span></span>'/>
</span><br />

<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">emissiveColor</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_emissiveColor"
                                 class="prototype">emissiveColor</a></span></span>'/>
</span><br />

<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">specularColor</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_specularColor"
                                 class="prototype">specularColor</a></span></span>'/>
</span><br />

<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">transparency</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_transparency"
                                 class="prototype">transparency</a></span></span>'/>
</span><br />

<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">shininess</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_shininess"
                                 class="prototype">shininess</a></span></span>'/>
</span><br />

<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">ambientIntensity</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_ambientIntensity"
                                 class="prototype">ambientIntensity</a></span></span>'/>
</span></div><span title="IS connects ProtoDeclare interface fields to node fields inside ProtoDeclare definitions"></<span class="element">IS</span>>
</span></div><span title="Material specifies surface rendering properties for associated geometry"></<span class="element">Material</span>>
</span><br /><span title="XML comment"><!-- Only first node (the node type) is renderable, others are along for the ride --></span>
<br />
<a name="MaterialModulatorScript"> </a> 
<!-- <span class="idName">MaterialModulatorScript</span> <i>ROUTEs</i>: 
[<a title="go to this ROUTE" href="#ROUTE_1"><i>from</i> <span class="idName">ModulationClock</span>.<span class="attribute">cycleTime</span> <i>to</i> <span class="attribute">clockTrigger</span>
                     </a>]
[<a title="go to this ROUTE" href="#ROUTE_0"><i>from</i> <span class="attribute">newColor</span> <i>to</i> <span class="idName">MaterialNode</span>.<span class="attribute">diffuseColor</span>
                     </a>]
 --><br />
<<span class="element">Script</span> <span class="attribute">DEF</span>='<span class="idName" title="DEF name is a unique ID for a given node">MaterialModulatorScript</span>'>
<div class="indent">
<span title="A field element defines an interface attribute or node for a parent Script"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">enabled</span>' <span class="attribute">type</span>='<span class="value">SFBool</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span><br />

<span title="A field element defines an interface attribute or node for a parent Script"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">diffuseColor</span>' <span class="attribute">type</span>='<span class="value">SFColor</span>' <span class="attribute">accessType</span>='<span class="value">inputOutput</span>'/>
</span><br />

<span title="A field element defines an interface attribute or node for a parent Script"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">newColor</span>' <span class="attribute">type</span>='<span class="value">SFColor</span>' <span class="attribute">accessType</span>='<span class="value">outputOnly</span>'/>
</span><br />

<span title="A field element defines an interface attribute or node for a parent Script"><<span class="prototype">field</span> <span class="attribute">name</span>='<span class="prototype">clockTrigger</span>' <span class="attribute">type</span>='<span class="value">SFTime</span>' <span class="attribute">accessType</span>='<span class="value">inputOnly</span>'/>
</span><br />

<span title="IS connects ProtoDeclare interface fields to node fields inside ProtoDeclare definitions"><<span class="element">IS</span>>
</span><div class="indent">
<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">enabled</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_enabled"
                                 class="prototype">enabled</a></span></span>'/>
</span><br />

<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">diffuseColor</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_diffuseColor"
                                 class="prototype">diffuseColor</a></span></span>'/>
</span></div><span title="IS connects ProtoDeclare interface fields to node fields inside ProtoDeclare definitions"></<span class="element">IS</span>>
</span><br />
</div class="indent">
</div class="indent">
</div class="indent">
</div class="indent">
<code>
                           <b><![CDATA[</b>
                        </code>
                        <pre>
          
ecmascript:
function initialize ()
{
    newColor = diffuseColor; // start with correct 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.print ('diffuseColor=(' + red +',' + green + ',' + blue + ') newColor=' + newColor.toString() + '\n');
        }
}

        </pre>
                        <code>
                           <b>]]></b>
                        </code>
<div class="indent">
<div class="indent">
<div class="indent">
<div class="indent">
</div></<span class="element">Script</span>>
<br /><span title="XML comment"><!-- Clock tickles Script to wake up and compute a new value --></span>
<br />
<a name="ROUTE_0"> </a> 
<span title="ROUTE connects fields between nodes to enable event passing"><<span class="route">ROUTE</span> <span class="attribute">fromNode</span>='<a title="go to the original DEF node definition" href="#MaterialModulatorScript"
                        class="idName">MaterialModulatorScript</a>' <span class="attribute">fromField</span>='<span class="value">newColor</span>' <span class="attribute">toNode</span>='<a title="go to the original DEF node definition" href="#MaterialNode"
                        class="idName">MaterialNode</a>' <span class="attribute">toField</span>='<span class="value">diffuseColor</span>'/>
</span><br />
<a name="ModulationClock"> </a> 
<!-- <span class="idName">ModulationClock</span> <i>ROUTE</i>: 
[<a title="go to this ROUTE" href="#ROUTE_1"><i>from</i> <span class="attribute">cycleTime</span> <i>to</i> <span class="idName">MaterialModulatorScript</span>.<span class="attribute">clockTrigger</span>
                     </a>]
 --><br />
<span title="TimeSensor continuously generates events as time passes"><<span class="element">TimeSensor</span> <span class="attribute">DEF</span>='<span class="idName" title="DEF name is a unique ID for a given node">ModulationClock</span>' <span class="attribute">cycleInterval</span>='<span class="value">0.1</span>' <span class="attribute">loop</span>='<span class="value">true</span>'>
</span><div class="indent">
<span title="IS connects ProtoDeclare interface fields to node fields inside ProtoDeclare definitions"><<span class="element">IS</span>>
</span><div class="indent">
<span title="connect tags define each ProtoDeclare field connection within ProtoDeclare definitions"><<span class="element">connect</span> <span class="attribute">nodeField</span>='<span class="prototype" title="connect interface events to this field in given node">enabled</span>' <span class="attribute">protoField</span>='<span title="field interface connecting events into the prototype interior"><span class="prototype"><a title="go to the protoField definition"
                                 href="#MaterialModulatorProtoField_enabled"
                                 class="prototype">enabled</a></span></span>'/>
</span></div><span title="IS connects ProtoDeclare interface fields to node fields inside ProtoDeclare definitions"></<span class="element">IS</span>>
</span></div><span title="TimeSensor continuously generates events as time passes"></<span class="element">TimeSensor</span>>
</span><br />
<a name="ROUTE_1"> </a> 
<span title="ROUTE connects fields between nodes to enable event passing"><<span class="route">ROUTE</span> <span class="attribute">fromNode</span>='<a title="go to the original DEF node definition" href="#ModulationClock"
                        class="idName">ModulationClock</a>' <span class="attribute">fromField</span>='<span class="value">cycleTime</span>' <span class="attribute">toNode</span>='<a title="go to the original DEF node definition" href="#MaterialModulatorScript"
                        class="idName">MaterialModulatorScript</a>' <span class="attribute">toField</span>='<span class="value">clockTrigger</span>'/>
</span></div></<span class="prototype">ProtoBody</span>>
</div><span title="ProtoDeclare is a Prototype declaration, defining a new node made up of other node(s)"></<span class="prototype">ProtoDeclare</span>>
</span><br /><span title="XML comment"><!-- Rendered geometry for the ProtoInstance now follows prototype declaration --></span>
<br />

<span title="Transform translates, orients and scales child geometry within the local world coordinate system"><<span class="element">Transform</span> <span class="attribute">translation</span>='<span class="value">0 1 0</span>'>
</span><div class="indent">
<span title="Shape contains geometry and optional corresponding Appearance"><<span class="element">Shape</span>>
</span><div class="indent">
<span title="Sphere is a geometry primitive node"><<span class="element">Sphere</span>/>
</span><br />

<span title="Appearance specifies visual properties of geometry by containing Material, texture and TextureTransform nodes"><<span class="element">Appearance</span>>
</span><div class="indent">
                        <a name="MaterialModulatorInstance"> </a> 
<!-- <span class="idName">MaterialModulatorInstance</span> <i>ROUTE</i>: 
[<a title="go to this ROUTE" href="#ROUTE_3"><i>from</i> <span class="idName">EventToggler</span>.<span class="attribute">toggle</span> <i>to</i> <span class="attribute">enabled</span>
                        </a>]
 --><br />
<span title="ProtoInstance creates an instance of a locally or externally declared prototype node"><<span class="prototype">ProtoInstance</span> <span class="attribute">name</span>='<a title="go to the defining ProtoDeclare for this prototype instance"
                           href="#ProtoDeclare_MaterialModulator"
                           class="prototype">MaterialModulator</a>' <span class="attribute">DEF</span>='<span class="idName" title="DEF name is a unique ID for a given node">MaterialModulatorInstance</span>' <span class="attribute">containerField</span>='<span class="value">material</span>'>
</span><div class="indent">
<span title="A fieldValue element is used to re-initialize a default field value in a ProtoInstance"><<span class="prototype">fieldValue</span> <span class="attribute">name</span>='<span class="prototype">enabled</span>' <span class="attribute">value</span>='<span class="value">true</span>'/>
</span><br />

<span title="A fieldValue element is used to re-initialize a default field value in a ProtoInstance"><<span class="prototype">fieldValue</span> <span class="attribute">name</span>='<span class="prototype">diffuseColor</span>' <span class="attribute">value</span>='<span class="value">0.5 0.1 0.1</span>'/>
</span></div><span title="ProtoInstance creates an instance of a locally or externally declared prototype node"></<span class="prototype">ProtoInstance</span>>
</span></div><span title="Appearance specifies visual properties of geometry by containing Material, texture and TextureTransform nodes"></<span class="element">Appearance</span>>
</span></div><span title="Shape contains geometry and optional corresponding Appearance"></<span class="element">Shape</span>>
</span></div><span title="Transform translates, orients and scales child geometry within the local world coordinate system"></<span class="element">Transform</span>>
</span><br /><span title="XML comment"><!-- Selectable Text design pattern has transparent Box and TouchSensor description as a tooltip --></span>
<br />

<span title="Transform translates, orients and scales child geometry within the local world coordinate system"><<span class="element">Transform</span> <span class="attribute">translation</span>='<span class="value">0 -2 0</span>'>
</span><div class="indent">
<span title="Shape contains geometry and optional corresponding Appearance"><<span class="element">Shape</span>>
</span><div class="indent">
<span title="Text is a geometry primitive node"><<span class="element">Text</span> <span class="attribute">string</span>='
 "Enable/disable" <br /> "MaterialModulator" <br />'>
</span><div class="indent">
<span title="FontStyle defines the size, family, justification, and other styles used by Text nodes"><<span class="element">FontStyle</span> <span class="attribute">family</span>='<span class="value">"SANS"</span>' <span class="attribute">justify</span>='<span class="value">"MIDDLE" "MIDDLE"</span>' <span class="attribute">style</span>='<span class="value">BOLD</span>'/>
</span></div><span title="Text is a geometry primitive node"></<span class="element">Text</span>>
</span><br />

<span title="Appearance specifies visual properties of geometry by containing Material, texture and TextureTransform nodes"><<span class="element">Appearance</span>>
</span><div class="indent">
<span title="Material specifies surface rendering properties for associated geometry"><<span class="element">Material</span> <span class="attribute">diffuseColor</span>='<span class="value">0.9 0.9 0.9</span>'/>
</span></div><span title="Appearance specifies visual properties of geometry by containing Material, texture and TextureTransform nodes"></<span class="element">Appearance</span>>
</span></div><span title="Shape contains geometry and optional corresponding Appearance"></<span class="element">Shape</span>>
</span><br />

<span title="Shape contains geometry and optional corresponding Appearance"><<span class="element">Shape</span>>
</span><div class="indent">
<span title="Box is a geometry primitive node"><<span class="element">Box</span> <span class="attribute">size</span>='<span class="value">8 2 .001</span>'/>
</span><br />

<span title="Appearance specifies visual properties of geometry by containing Material, texture and TextureTransform nodes"><<span class="element">Appearance</span>>
</span><div class="indent">
<span title="Material specifies surface rendering properties for associated geometry"><<span class="element">Material</span> <span class="attribute">transparency</span>='<span class="value">1</span>'/>
</span></div><span title="Appearance specifies visual properties of geometry by containing Material, texture and TextureTransform nodes"></<span class="element">Appearance</span>>
</span></div><span title="Shape contains geometry and optional corresponding Appearance"></<span class="element">Shape</span>>
</span><br /><span title="XML comment"><!-- Toggle text to enable/disable MaterialModulator --></span>
<br />
<a name="TouchTextInterface"> </a> 
<!-- <span class="idName">TouchTextInterface</span> <i>ROUTE</i>: 
[<a title="go to this ROUTE" href="#ROUTE_2"><i>from</i> <span class="attribute">isActive</span> <i>to</i> <span class="idName">EventToggler</span>.<span class="attribute">set_boolean</span>
                  </a>]
 --><br />
<span title="TouchSensor tracks location & state of the pointing device, and detects when user points at geometry"><<span class="element">TouchSensor</span> <span class="attribute">DEF</span>='<span class="idName" title="DEF name is a unique ID for a given node">TouchTextInterface</span>' <span class="attribute">description</span>='<a href="Select to enable/disable MaterialModulator">Select to enable/disable MaterialModulator</a>'/>
</span><br />
<a name="EventToggler"> </a> 
<!-- <span class="idName">EventToggler</span> <i>ROUTEs</i>: 
[<a title="go to this ROUTE" href="#ROUTE_2"><i>from</i> <span class="idName">TouchTextInterface</span>.<span class="attribute">isActive</span> <i>to</i> <span class="attribute">set_boolean</span>
                  </a>]
[<a title="go to this ROUTE" href="#ROUTE_3"><i>from</i> <span class="attribute">toggle</span> <i>to</i> <span class="idName">MaterialModulatorInstance</span>.<span class="attribute">enabled</span>
                  </a>]
 --><br />
<span title="BooleanToggle maintains state and negates output when a true input is provided"><<span class="element">BooleanToggle</span> <span class="attribute">DEF</span>='<span class="idName" title="DEF name is a unique ID for a given node">EventToggler</span>' <span class="attribute">containerField</span>='<span class="value">children</span>'/>
</span><br />
<a name="ROUTE_2"> </a> 
<span title="ROUTE connects fields between nodes to enable event passing"><<span class="route">ROUTE</span> <span class="attribute">fromNode</span>='<a title="go to the original DEF node definition" href="#TouchTextInterface"
                     class="idName">TouchTextInterface</a>' <span class="attribute">fromField</span>='<span class="value">isActive</span>' <span class="attribute">toNode</span>='<a title="go to the original DEF node definition" href="#EventToggler"
                     class="idName">EventToggler</a>' <span class="attribute">toField</span>='<span class="value">set_boolean</span>'/>
</span><br />
<a name="ROUTE_3"> </a> 
<span title="ROUTE connects fields between nodes to enable event passing"><<span class="route">ROUTE</span> <span class="attribute">fromNode</span>='<a title="go to the original DEF node definition" href="#EventToggler"
                     class="idName">EventToggler</a>' <span class="attribute">fromField</span>='<span class="value">toggle</span>' <span class="attribute">toNode</span>='<a title="go to the original DEF node definition"
                     href="#MaterialModulatorInstance"
                     class="idName">MaterialModulatorInstance</a>' <span class="attribute">toField</span>='<span class="value">enabled</span>'/>
</span></div><span title="Transform translates, orients and scales child geometry within the local world coordinate system"></<span class="element">Transform</span>>
</span></div><span title="Scene is the root node that contains an X3D scene graph"></<span class="element">Scene</span>>
</span></div><span title="X3D is the top-most XML element for an Extensible 3D (X3D) Graphics file"></<span class="element">X3D</span>>
</span><br /><span style="color:white">
<!--
</span>
         <div class="center">
            <hr style="width:100%"/>
            <b>
               <i>Index for ProtoDeclare definition</i>
            </b>: 
<a title="go to this declaration" href="#ProtoDeclare_MaterialModulator"
               class="prototype">MaterialModulator</a>
<br /><hr width="50%"/>
            <b>
               <i>Index for DEF nodes</i>
            </b>: 
<a title="go to this BooleanToggle node" href="#EventToggler" class="idName">EventToggler</a>,
<a title="go to this ProtoInstance node" href="#MaterialModulatorInstance"
               class="idName">MaterialModulatorInstance</a>,
<a title="go to this Script node" href="#MaterialModulatorScript" class="idName">MaterialModulatorScript</a>,
<a title="go to this Material node" href="#MaterialNode" class="idName">MaterialNode</a>,
<a title="go to this TimeSensor node" href="#ModulationClock" class="idName">ModulationClock</a>,
<a title="go to this TouchSensor node" href="#TouchTextInterface" class="idName">TouchTextInterface</a>
            <hr style="width:100%"/>
         </div>
         <span style="color:white">
-->
</span>
      </div>
      <p style="text-align:center; background-color:lightgrey">
         <span style="color:lightgrey"><!--</span>
Color key: <!--(matching X3D and XML terminology) -->
<<span class="element">X3dNode</span>
         <span class="idName"> DEF</span>='<span class="idName">idName</span>' <span class="attribute">field</span>='<span class="value">value</span>'/> 
 matches 
<<span class="element">XmlElement</span>
         <span class="idName"> DEF</span>='<span class="idName">idName</span>' <span class="attribute">attribute</span>='<span class="value">value</span>'/>    
<<span class="prototype">Prototype</span> 
         <span class="attribute">name</span>='<span class="prototype">ProtoName</span>'>
        <<span class="prototype">field</span>
         <span class="attribute">name</span>='<span class="prototype">fieldName</span>'/> </<span class="prototype">Prototype</span>>
<span style="color:lightgrey"> --></span>
      </p>
      <p style="text-align:center; background-color:white">
         <span style="color:white"><!--</span>

                    Additional help information about X3D scenes:  
                    <a href="http://www.web3d.org/x3d/content/examples/X3dResources.html"
            title="Numerous resources that support X3D graphics">X3D Resources</a>,
                    <a href="http://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html"
            title="Style guidelines, authoring tips and best practices">X3D Scene Authoring Hints</a>
                    and
                    <a href="http://www.web3d.org/x3d/content/X3dTooltips.html"
            title="Summary descriptions and authoring hints for each X3D node (element) and field (attribute)">X3D Tooltips</a>
         <span style="color:white">--></span>
      </p>
   </body>
</html>