<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive'  version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.0.xsd ' >
<head>
<meta name='titlecontent=' test_binding1.x3d '/>
<meta name='MovingImagecontent='test-binding1-movie.mpg'/>
<meta name='referencecontent=' http://www.nist.gov/vrml.html '/>
<meta name='referencecontent=' http://www.itl.nist.gov/div897/ctg/vrml/vrml.html '/>
<meta name='creatorcontent=' http://www.itl.nist.gov/div897/ctg/vrml/members.html '/>
<meta name='disclaimercontent=' This file was provided by the National Institute of Standards and Technology, and is part of the X3D Conformance Test Suite, available at http://www.nist.gov/vrml.html The information contained within this file is provided for use in establishing conformance to the ISO VRML97 Specification. Conformance to this test does not imply recommendation or endorsement by the National Institute of Standards and Technology (NIST). This software can be redistributed and/or modified freely provided that any derivative works bear some notice that they are derived from it, and any modified versions bear some notice that they have been modified. '/>
<meta name='referencecontent=' Original NIST Conformance Testing Group, https://www.itl.nist.gov/div897/ctg/vrml '/>
<meta name='referencecontent=' Interactive Conformance Testing for VRML, Mary Brady and Lynn Rosenthal, NIST, created 8 September 2010 and updated 25 August 2016, https://www.nist.gov/itl/ssd/information-systems-group/interactive-conformance-testing-vrml '/>
<meta name='infocontent='Correct definition and compliance of this conformance scene is maintained by the X3D Working Group, https://www.web3d.org/working-groups/x3d'/>
<meta name='translatorcontent='Michael Kass NIST, Don Brutzman NPS'/>
<meta name='translatedcontent='21 January 2001'/>
<meta name='modifiedcontent='28 August 2023'/>
<meta name='descriptioncontent='This test addresses the ability of a background node to send true events when it is the currently binded background. Two backgrounds are defined in the local coordinate system. The first one is binded by default. The test then sends a false event to the first background and true event to the second background. This will make the second background the currently binded background. The second background should then start sending true events (via the is_Bound field). These events are caputure and use to start a timer. The test should generate a blue sky image first and then a sunset background with some text flashing on it. The test can be started by clicking on the text displayed when the test is first loaded.'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/ConformanceNist/BindableNodes/Background/test_binding1.x3d '/>
<meta name='generatorcontent=' Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html '/>
<meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: colors1, set_backfalse, set_backtrue, sky-back1, sky-back2, the-material1, the-material5, the-touch, the-view, timer1

Index for Viewpoint node: the-view
-->
<Scene>
<WorldInfo title='test_binding1.x3d'/>
<NavigationInfo type='"EXAMINE" "WALK" "FLY" "ANY"'/>
<Group>
<Viewpoint DEF='the-viewdescription='Back Viewposition='0 0 20'/>
</Group>
<Group>

</Group>
<Transform translation='0.5 3 0'>
<Shape>
<Appearance>
<!-- ROUTE information for the-material1 node:  [from colors1.value_changed to diffuseColor ] -->
<Material DEF='the-material1diffuseColor='0 0 1emissiveColor='0 0 1'/>
</Appearance>
<Text string='"Background 2 sending true Event"'>
<FontStyle justify='"MIDDLE" "MIDDLE"'/>
</Text>
</Shape>
</Transform>
<Transform scale='0.04 0.04 0.04translation='0.5 0 0'>
<Shape>
<Appearance>
<Material DEF='the-material5diffuseColor='1 0 0'/>
</Appearance>
<Text string='"CLICK HERE TO START"'>
<FontStyle justify='"MIDDLE" "MIDDLE"size='32style='BOLD'/>
</Text>
</Shape>
<!-- ROUTE information for the-touch node:  [from touchTime to set_backtrue.value_in ] [from touchTime to set_backfalse.value_in ] [from touchTime to timer1.startTime ] -->
<TouchSensor DEF='the-touchdescription='touch to activate'/>
</Transform>
<!-- ROUTE information for timer1 node:  [from the-touch.touchTime to startTime ] [from sky-back2.isBound to enabled ] [from fraction_changed to colors1.set_fraction ] -->
<TimeSensor DEF='timer1cycleInterval='8enabled='false'/>

<!-- ROUTE information for colors1 node:  [from timer1.fraction_changed to set_fraction ] [from value_changed to the-material1.diffuseColor ] -->
<ColorInterpolator DEF='colors1key='0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1keyValue='1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0 0 0 1 1 0 0'/>

<!-- ROUTE information for set_backtrue node:  [from the-touch.touchTime to value_in ] [from value_out to sky-back2.set_bind ] -->
<Script DEF='set_backtrue'>
<field name='value_intype='SFTimeaccessType='inputOnly'/>
<field name='value_outtype='SFBoolaccessType='outputOnly'/>
<![CDATA[
      
ecmascript:
function value_in (the_value)
{
	value_out = true;
}

    
]]>
</Script>
<!-- ROUTE information for set_backfalse node:  [from the-touch.touchTime to value_in ] [from value_out to sky-back1.set_bind ] -->
<Script DEF='set_backfalse'>
<field name='value_intype='SFTimeaccessType='inputOnly'/>
<field name='value_outtype='SFBoolaccessType='outputOnly'/>
<![CDATA[
      
ecmascript:
function value_in (the_value)
{
    value_out = false;
}

    
]]>
</Script>
< ROUTE  fromNode=' the-touch' fromField='touchTime' toNode=' set_backtrue' toField='value_in'/>
< ROUTE  fromNode=' the-touch' fromField='touchTime' toNode=' set_backfalse' toField='value_in'/>
< ROUTE  fromNode=' the-touch' fromField='touchTime' toNode=' timer1' toField='startTime'/>
< ROUTE  fromNode=' set_backfalse' fromField='value_out' toNode=' sky-back1' toField='set_bind'/>
< ROUTE  fromNode=' set_backtrue' fromField='value_out' toNode=' sky-back2' toField='set_bind'/>
< ROUTE  fromNode=' sky-back2' fromField='isBound' toNode=' timer1' toField='enabled'/>
< ROUTE  fromNode=' timer1' fromField='fraction_changed' toNode=' colors1' toField='set_fraction'/>
< ROUTE  fromNode=' colors1' fromField='value_changed' toNode=' the-material1' toField='diffuseColor'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: colors1, set_backfalse, set_backtrue, sky-back1, sky-back2, the-material1, the-material5, the-touch, the-view, timer1

Index for Viewpoint node: the-view
-->

Event Graph ROUTE Table entries with 8 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

the-touch
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
set_backtrue
Script
value_in
SFTime

 
 
then
set_backtrue
Script
value_out
SFBool

ROUTE
event to
(2)
sky-back2
Background
set_bind
SFBool

 
 
then
sky-back2
Background
isBound
SFBool

ROUTE
event to
(3)
timer1
TimeSensor
enabled
SFBool

 
 
then
timer1
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(4)
colors1
ColorInterpolator
set_fraction
SFFloat

 
 
then
colors1
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(5)
the-material1
Material
diffuseColor
SFColor
the-touch
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
set_backfalse
Script
value_in
SFTime

 
 
then
set_backfalse
Script
value_out
SFBool

ROUTE
event to
(2)
sky-back1
Background
set_bind
SFBool
the-touch
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
timer1
TimeSensor
startTime
SFTime

 
 
then
timer1
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
colors1
ColorInterpolator
set_fraction
SFFloat

 
 
then
colors1
ColorInterpolator
value_changed
SFColor

ROUTE
event to
(3)
the-material1
Material
diffuseColor
SFColor



-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/ConformanceNist/BindableNodes/Background/test_binding1Index.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/BindableNodes/Background/test_binding1.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)
-->

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