<?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='StringSensorExample.x3d'/>
<meta name='descriptioncontent='A StringSensor example that displays typed text in the world.'/>
<meta name='creatorcontent='Leonard Daly and Don Brutzman'/>
<meta name='createdcontent='7 June 2006'/>
<meta name='modifiedcontent='14 June 2020'/>
<meta name='referencecontent=' https://X3dGraphics.com '/>
<meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/>
<meta name='rightscontent='Copyright (c) 2006, Daly Realism and Don Brutzman'/>
<meta name='subjectcontent=' X3D book, X3D graphics, X3D-Edit, http://www.x3dGraphics.com '/>
<meta name='identifiercontent=' https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter08UserInteractivity/StringSensorExample.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

Index for DEF nodes : Converter, DisplayText, GenText

Index for Viewpoint image : Viewpoint_1
-->
<Scene>
<WorldInfo title='StringSensor.x3d'/>
<Background skyColor='1 1 1'/>
<Viewpoint description='Book Viewposition='-0.02 0.01 6.85'/>
<!-- ROUTE information for GenText node:  [from enteredText to Converter.SFString_MFString ] -->
<StringSensor DEF='GenText'/>
<Transform translation='0 0.8 0'>
<Transform translation='0 0 -.1'>
<Shape>
<Appearance>
<Material diffuseColor='1 1 .6'/>
</Appearance>
<Box size='8 1.5 .01'/>
</Shape>
</Transform>
<Transform translation='-3.8 0.2 0'>
<Shape>
<Appearance>
<Material diffuseColor='0 0 1'/>
</Appearance>
<!-- ROUTE information for DisplayText node:  [from Converter.MFString_out to string ] -->
<Text DEF='DisplayText'>
<FontStyle justify='"BEGIN" "MIDDLE"size='0.75'/>
</Text>
</Shape>
</Transform>
<!-- convert StringSensor SFString into Text node MFString by using explicit typecasting in ECMAScript -->
<!-- ROUTE information for Converter node:  [from GenText.enteredText to SFString_MFString ] [from MFString_out to DisplayText.string ] -->
<Script DEF='Converter'
  url=' "StringSensorScriptConverter.js" "https://X3dGraphics.com/examples/X3dForWebAuthors/Chapter08UserInteractivity/StringSensorScriptConverter.js" '>
<field name='SFString_MFStringtype='SFStringaccessType='inputOnly'/>
<field name='MFString_outtype='MFStringaccessType='outputOnly'/>
<field name='SFFloat_Xouttype='SFFloataccessType='outputOnly'/>
<field name='SFFloat_Youttype='SFFloataccessType='outputOnly'/>
<field name='SFFloat_Zouttype='SFFloataccessType='outputOnly'/>
</Script>
<ROUTE fromNode='GenTextfromField='enteredTexttoNode='ConvertertoField='SFString_MFString'/>
<ROUTE fromNode='ConverterfromField='MFString_outtoNode='DisplayTexttoField='string'/>
<Transform translation='0 -1.25 0'>
<Group>
<Shape>
<Text string='"StringSensor lets users enter text..." "please type to test"'>
<FontStyle family='"SANS"justify='"MIDDLE" "BEGIN"size='0.5'/>
</Text>
<Appearance>
<Material diffuseColor='0.7 0.7 0.7'/>
</Appearance>
</Shape>
</Group>
</Transform>
</Transform>
</Scene>
</X3D>
<!--

Index for DEF nodes : Converter, DisplayText, GenText

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. -->