<?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>
<meta name='titlecontent='IntegerTriggerExample.x3d'/>
<meta name='descriptioncontent='An IntegerTrigger node controls the display of colored text.'/>
<meta name='creatorcontent='Don Brutzman and Leonard Daly'/>
<meta name='createdcontent='1 March 2008'/>
<meta name='modifiedcontent='14 June 2020'/>
<meta name='referencecontent='KelpTank.x3d'/>
<meta name='identifiercontent=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter09EventUtilitiesScripting/IntegerTriggerExample.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

Index for DEF nodes : Filter1, Filter2, Filter3, MessageText, SwitchColoredTextGroups, Touch1, Touch2, Touch3, TransparentBox

Index for Viewpoint image : Viewpoint_1
-->
<Scene>
<WorldInfo title='IntegerTrigger.x3d'/>
<Background skyColor='1 1 1'/>
<Viewpoint description='Select text to change colorposition='0 0 6'/>
<!-- ROUTE information for SwitchColoredTextGroups node:  [from Filter1.triggerValue to whichChoice ] [from Filter2.triggerValue to whichChoice ] [from Filter3.triggerValue to whichChoice ] -->
<Switch DEF='SwitchColoredTextGroupswhichChoice='0'>
<Group>
<Shape>
<Appearance>
<Material diffuseColor='1 0 0'/>
</Appearance>
<Text DEF='MessageTextstring='"Select these words" "to change color"'>
<FontStyle justify='"MIDDLE" "BEGIN"'/>
</Text>
</Shape>
<!-- TransparentBox makes selection of Text using TouchSensor easier for user -->
<Shape DEF='TransparentBox'>
<Box size='6 2 0.02'/>
<Appearance>
<Material transparency='1'/>
</Appearance>
</Shape>
<!-- ROUTE information for Touch1 node:  [from isActive to Filter1.set_boolean ] -->
<TouchSensor DEF='Touch1description='touch to activate'/>
</Group>
<!-- Reuse Text geoemetry, paired with different Material colors -->
<Group>
<Shape>
<Appearance>
<Material diffuseColor='0 1 1'/>
</Appearance>
<Text USE='MessageText'/>
</Shape>
<Shape USE='TransparentBox'/>
<!-- ROUTE information for Touch2 node:  [from isActive to Filter2.set_boolean ] -->
<TouchSensor DEF='Touch2description='touch to activate'/>
</Group>
<Group>
<Shape>
<Appearance>
<Material diffuseColor='0.7 0.7 0'/>
</Appearance>
<Text USE='MessageText'/>
</Shape>
<Shape USE='TransparentBox'/>
<!-- ROUTE information for Touch3 node:  [from isActive to Filter3.set_boolean ] -->
<TouchSensor DEF='Touch3description='touch to activate'/>
</Group>
</Switch>
<!-- IntegerTrigger nodes used to switch child shapes, must use separate one for each output value -->
<!-- ROUTE information for Filter1 node:  [from Touch1.isActive to set_boolean ] [from triggerValue to SwitchColoredTextGroups.whichChoice ] -->
<IntegerTrigger DEF='Filter1integerKey='1containerField='children'/>
<!-- ROUTE information for Filter2 node:  [from Touch2.isActive to set_boolean ] [from triggerValue to SwitchColoredTextGroups.whichChoice ] -->
<IntegerTrigger DEF='Filter2integerKey='2containerField='children'/>
<!-- ROUTE information for Filter3 node:  [from Touch3.isActive to set_boolean ] [from triggerValue to SwitchColoredTextGroups.whichChoice ] -->
<IntegerTrigger DEF='Filter3integerKey='0containerField='children'/>
<ROUTE fromNode='Touch1fromField='isActivetoNode='Filter1toField='set_boolean'/>
<ROUTE fromNode='Touch2fromField='isActivetoNode='Filter2toField='set_boolean'/>
<ROUTE fromNode='Touch3fromField='isActivetoNode='Filter3toField='set_boolean'/>
<ROUTE fromNode='Filter1fromField='triggerValuetoNode='SwitchColoredTextGroupstoField='whichChoice'/>
<ROUTE fromNode='Filter2fromField='triggerValuetoNode='SwitchColoredTextGroupstoField='whichChoice'/>
<ROUTE fromNode='Filter3fromField='triggerValuetoNode='SwitchColoredTextGroupstoField='whichChoice'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : Filter1, Filter2, Filter3, MessageText, SwitchColoredTextGroups, Touch1, Touch2, Touch3, TransparentBox

Index for Viewpoint image : Viewpoint_1
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
-->

<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->