<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "http://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 =' http://www.web3d.org/specifications/x3d-3.3.xsd '>
<head>
<meta name='titlecontent='Button.x3d'/>
<meta name='descriptioncontent='Simple button: this file contains a Prototype declaration to manage a button that, when clicked, rotates 90 degrees and sends a URL. This button is used in "loader.wrl".'/>
<meta name='creatorcontent='David R. Nadeau'/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='1 July 1998'/>
<meta name='translatedcontent='2 February 2014'/>
<meta name='modifiedcontent='13 October 2015'/>
<meta name='referencecontent='Loader.x3d'/>
<meta name='referencecontent='originals/button.wrl'/>
<meta name='referencecontent=' http://www.siggraph.org/s98 '/>
<meta name='referencecontent=' http://www.siggraph.org/s98/conference/courses/18.html '/>
<meta name='referencecontent=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0469.htm '/>
<meta name='referencecontent=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm '/>
<meta name='referencecontent=' http://www.web3d.org/x3d/content/examples/X3dResources.html '/>
<meta name='identifiercontent=' http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Button.x3d '/>
<meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
<meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../license.html'/>
</head>
<!--

Index for ProtoDeclare definition : Button

Index for DEF nodes : Rotator, SendUrl, Timer, Touch, Trans
-->
<Scene>
<WorldInfo info='"Copyright (c) 1998, David R. Nadeau"title='Simple Button'/>
<ProtoDeclare name='Button'>
<ProtoInterface>
<field name='urltype='MFStringvalue=' ""
accessType='inputOutput'/>

<field name='textureUrltype='MFStringvalue=' ""
accessType='inputOutput'/>

<field name='url_changedtype='MFStringaccessType='outputOnly'/>
<field name='translationtype='SFVec3fvalue='0.0 0.0 0.0accessType='initializeOnly'/>
</ProtoInterface>
<ProtoBody>
<!-- ROUTE information for Trans node:  [from Rotator.value_changed to set_rotation ] -->
<Transform DEF='Trans'>
<IS>
<connect nodeField='translationprotoField='translation'/>
</IS>
<Shape>
<Appearance>
<Material diffuseColor='1.0 1.0 1.0'/>
<ImageTexture>
<IS>
<connect nodeField='urlprotoField='textureUrl'/>
</IS>
</ImageTexture>
</Appearance>
<Box size='1.0 1.0 1.0'/>
</Shape>
<!-- ROUTE information for Touch node:  [from touchTime to Timer.set_startTime ] [from touchTime to SendUrl.set_touchTime ] -->
<TouchSensor DEF='Touchdescription='Select to initiate button spin and scene loading'/>
</Transform>
<!-- ROUTE information for Timer node:  [from Touch.touchTime to set_startTime ] [from fraction_changed to Rotator.set_fraction ] -->
<TimeSensor DEF='TimerstopTime='1.0'/>
<!-- ROUTE information for Rotator node:  [from Timer.fraction_changed to set_fraction ] [from value_changed to Trans.set_rotation ] -->
<OrientationInterpolator DEF='Rotatorkey='0.0 1.0keyValue='0.0 1.0 0.0 0.0 0.0 1.0 0.0 1.571'/>
<!-- ROUTE information for SendUrl node:  [from Touch.touchTime to set_touchTime ] -->
<Script DEF='SendUrl'>
<field name='sendUrltype='MFStringaccessType='initializeOnly'/>
<field name='set_touchTimetype='SFTimeaccessType='inputOnly'/>
<field name='url_changedtype='MFStringaccessType='outputOnly'/>
<IS>
<connect nodeField='sendUrlprotoField='url'/>
<connect nodeField='url_changedprotoField='url_changed'/>
</IS>
<![CDATA[
          
ecmascript:
	function set_touchTime( tm, ts ) {
		url_changed = sendUrl;
	}

        
]]>
</Script>
<ROUTE fromNode='TouchfromField='touchTimetoNode='TimertoField='set_startTime'/>
<ROUTE fromNode='TimerfromField='fraction_changedtoNode='RotatortoField='set_fraction'/>
<ROUTE fromNode='RotatorfromField='value_changedtoNode='TranstoField='set_rotation'/>
<ROUTE fromNode='TouchfromField='touchTimetoNode='SendUrltoField='set_touchTime'/>
</ProtoBody>
</ProtoDeclare>
<!-- Display scene instructions for viewing an example scene with a corresponding prototype instance -->
<Background skyColor='0 0.333333 0.66667'/>
<Anchor description='select text to view parent scene'
  url=' "Loader.x3d" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Loader.x3d" "Loader.wrl" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Loader.wrl" '>
<Shape>
<Text string='"Button.x3d scene holds" "a prototype declaration" "" "Select this text to view example" "use in Loader.x3d scene"'>
<FontStyle justify='"MIDDLE" "MIDDLE"style='BOLD'/>
</Text>
<Appearance>
<Material diffuseColor='1 0.9 0.4'/>
</Appearance>
</Shape>
<!-- Selectable text: invisible box behind text makes selection easier -->
<Shape>
<Box size='12 5 0.1'/>
<Appearance>
<Material transparency='1'/>
</Appearance>
</Shape>
</Anchor>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : Button

Index for DEF nodes : Rotator, SendUrl, Timer, Touch, Trans
-->

<!-- 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)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->