<?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='Interactive'  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=' fraction.x3d '/>
<meta name='MovingImagecontent='fraction-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=' 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='Test the fraction_changed field of a TimeSensor node. Two TimeSensors with cycleIntervals of 2 and 4 seconds animate a blue and green Sphere geometry respectively along the same distance. Because the cycleInterval of one TimeSensor is half that of the other, the fraction_changed events are routed to one PositionInterpolator twice as fast as the other TimeSensor, and the blue Sphere completes its animation twice as fast as the green Sphere. To verify this, click on the red Sphere to start the animation.'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/ConformanceNist/Sensors/TimeSensor/fraction.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: COLOR, first_ball, INTERP2, INTERP3, second_ball, third_ball, TIME1, TIME2, TOUCH

Index for Viewpoint node: Viewpoint_1
-->
<Scene>
<WorldInfo title='fraction.x3d'/>
<NavigationInfo type='"EXAMINE" "WALK" "FLY" "ANY"'/>
<Viewpoint description='Front View'/>
<!-- ROUTE information for INTERP2 node:  [from TIME1.fraction_changed to set_fraction ] [from value_changed to second_ball.translation ] -->
<PositionInterpolator DEF='INTERP2key='0 0.25 0.5 0.75 1keyValue='0 2.5 0 3 2.5 0 0 2.5 0 -3 2.5 0 0 2.5 0'/>

<!-- ROUTE information for INTERP3 node:  [from TIME2.fraction_changed to set_fraction ] [from value_changed to third_ball.translation ] -->
<PositionInterpolator DEF='INTERP3key='0 0.25 0.5 0.75 1keyValue='0 -2.5 0 3 -2.5 0 0 -2.5 0 -3 -2.5 0 0 -2.5 0'/>

<Transform DEF='first_balltranslation='-5 0 0'>
<!-- ROUTE information for TOUCH node:  [from touchTime to TIME1.startTime ] [from touchTime to TIME2.startTime ] -->
<TouchSensor DEF='TOUCHdescription='touch to activate'/>

<!-- ROUTE information for TIME1 node:  [from TOUCH.touchTime to startTime ] [from fraction_changed to INTERP2.set_fraction ] -->
<TimeSensor DEF='TIME1cycleInterval='4'/>

<!-- ROUTE information for TIME2 node:  [from TOUCH.touchTime to startTime ] [from fraction_changed to INTERP3.set_fraction ] -->
<TimeSensor DEF='TIME2cycleInterval='2'/>

<Shape>
<Appearance>
<Material diffuseColor='1 0 0'/>
</Appearance>
<Sphere/>
</Shape>
</Transform>
<!-- ROUTE information for second_ball node:  [from INTERP2.value_changed to translation ] -->
<Transform DEF='second_balltranslation='0 2.5 0'>
<Shape>
<Appearance>
<Material diffuseColor='0 1 0'/>
</Appearance>
<Sphere/>
</Shape>
</Transform>
<!-- ROUTE information for third_ball node:  [from INTERP3.value_changed to translation ] -->
<Transform DEF='third_balltranslation='0 -2.5 0'>
<Shape>
<Appearance>
<Material DEF='COLORdiffuseColor='0 0 1'/>
</Appearance>
<Sphere/>
</Shape>
</Transform>
< ROUTE  fromNode=' TOUCH' fromField='touchTime' toNode=' TIME1' toField='startTime'/>
< ROUTE  fromNode=' TOUCH' fromField='touchTime' toNode=' TIME2' toField='startTime'/>
< ROUTE  fromNode=' TIME1' fromField='fraction_changed' toNode=' INTERP2' toField='set_fraction'/>
< ROUTE  fromNode=' TIME2' fromField='fraction_changed' toNode=' INTERP3' toField='set_fraction'/>
< ROUTE  fromNode=' INTERP2' fromField='value_changed' toNode=' second_ball' toField='translation'/>
< ROUTE  fromNode=' INTERP3' fromField='value_changed' toNode=' third_ball' toField='translation'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: COLOR, first_ball, INTERP2, INTERP3, second_ball, third_ball, TIME1, TIME2, TOUCH

Index for Viewpoint node: Viewpoint_1
-->

Event Graph ROUTE Table entries with 6 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.

TOUCH
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
TIME1
TimeSensor
startTime
SFTime

 
 
then
TIME1
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
INTERP2
PositionInterpolator
set_fraction
SFFloat

 
 
then
INTERP2
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(3)
second_ball
Transform
translation
SFVec3f
TOUCH
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
TIME2
TimeSensor
startTime
SFTime

 
 
then
TIME2
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
INTERP3
PositionInterpolator
set_fraction
SFFloat

 
 
then
INTERP3
PositionInterpolator
value_changed
SFVec3f

ROUTE
event to
(3)
third_ball
Transform
translation
SFVec3f



-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/ConformanceNist/Sensors/TimeSensor/fractionIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/ConformanceNist/Sensors/TimeSensor/fraction.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. -->