<?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">
<X3D profile='Immersive'
version='3.3'
xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance'
xsd:noNamespaceSchemaLocation
='
https://www.web3d.org/specifications/x3d-3.3.xsd
'
>
<head>
</head>
<!--
-->
<Scene>
<WorldInfo title='MaterialModulatorExamples.x3d'/>
<ExternProtoDeclare name='MaterialModulator' appinfo='mimic a Material node and modulate the diffuseColor field as an animation effect'
documentation='
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorIndex.html
'
url='
"MaterialModulator.x3d#MaterialModulator" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulator.x3d#MaterialModulator" '
>
<field name='enabled' type='SFBool' accessType='inputOutput'
appinfo='default value true'
/>
<field name='diffuseColor' type='SFColor' accessType='inputOutput'
appinfo='default value 0.8 0.8 0.8'
/>
<field name='emissiveColor' type='SFColor' accessType='inputOutput'
appinfo='default value 0 0 0'
/>
<field name='specularColor' type='SFColor' accessType='inputOutput'
appinfo='default value 0 0 0'
/>
<field name='transparency' type='SFFloat' accessType='inputOutput'
appinfo='default value 0.0'
/>
<field name='shininess' type='SFFloat' accessType='inputOutput'
appinfo='default value 0.2'
/>
<field name='ambientIntensity' type='SFFloat' accessType='inputOutput'
appinfo='default value 0.2'
/>
</ExternProtoDeclare>
<!-- Rendered geometry for the ProtoInstance now follows external prototype declaration -->
<Transform rotation='-0.8 0.93923 0.18785 5.759586' translation='-2 1 0'>
<Shape DEF='ModulatingBoxShape'>
<Box/>
<Appearance>
<fieldValue name='enabled' value='true'/>
<fieldValue name='diffuseColor' value='0.5 0.1 0.1'/>
<!-- fieldValue declarations for other Material attributes can appear here -->
</ProtoInstance>
</Appearance>
</Shape>
</Transform>
<Transform rotation='1 0 0 0.523599' translation='2 1 0'>
<Shape>
<Cylinder/>
<Appearance>
<!-- note that ProtoInstance USE does not require name='MaterialModulator' -->
<ProtoInstance USE='
MaterialModulatorInstance' containerField='material'/>
</Appearance>
</Shape>
</Transform>
<Transform translation='-2 3.5 0'>
<Shape>
<Text string='"DEF original"'>
<FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.5' style='BOLD'/>
</Text>
<Appearance DEF='TextAppearance'>
<Material diffuseColor='0.9 0.9 0.9'/>
</Appearance>
</Shape>
</Transform>
<Transform translation='2 3.5 0'>
<Shape>
<Text string='"USE copy"'>
<FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' size='0.5' style='BOLD'/>
</Text>
<Appearance USE='
TextAppearance'/>
</Shape>
</Transform>
<Transform translation='0 -2 0'>
<Shape>
<Text string='
"enable/disable"
"MaterialModulator"
'>
<FontStyle family='"SANS"' justify='"MIDDLE" "MIDDLE"' style='BOLD'/>
</Text>
<Appearance USE='
TextAppearance'/>
</Shape>
<!-- Selectable Text design pattern has transparent Box and TouchSensor description as a tooltip -->
<Shape>
<Box size='8 2 .001'/>
<Appearance>
<Material transparency='1'/>
</Appearance>
</Shape>
<!-- Toggle text to enable/disable MaterialModulator -->
<
ROUTE
fromNode='
TouchTextInterface' fromField='isActive' toNode='
EventToggler' toField='set_boolean'/>
<
ROUTE
fromNode='
EventToggler' fromField='toggle' toNode='
MaterialModulatorInstance' toField='enabled'/>
</Transform>
</Scene>
</X3D>
<!--
-->
-->
<!--
Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorExamplesIndex.html
-->
<!--
Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter14Prototypes/MaterialModulatorExamples.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.
-->