<?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>
<component level='3name='Interpolation'/>
<meta name='titlecontent=' CoordinateInterpolator2dExample.x3d '/>
<meta name='descriptioncontent='Example to interpolate a Vector2FloatArray - click geometry to activate animation loop.'/>
<meta name='creatorcontent='Don Brutzman, Jeff Weekley, Jane Wu'/>
<meta name='createdcontent='9 October 2001'/>
<meta name='modifiedcontent='20 October 2019'/>
<meta name='referencecontent=' https://www.web3d.org/technicalinfo/specifications/vrml97/part1/concepts.html#4.6.8 '/>
<meta name='referencecontent=' https://www.web3d.org/technicalinfo/specifications/vrml97/part1/nodesRef.html#CoordinateInterpolator '/>
<meta name='referencecontent=' https://www.web3d.org/technicalinfo/specifications/vrml97/part1/nodesRef.html#Extrusion '/>
<meta name='subjectcontent='CoordinateInterpolator2D'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Basic/development/CoordinateInterpolator2dExample.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, 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: AnimatedCrossSectionExtrusion, Clock, InterpolateCrossSection, Toucher

Index for Viewpoint node: Viewpoint_1
-->
<Scene>
<WorldInfo title='CoordinateInterpolator2dExample.x3d'/>
<Viewpoint description='Click to activate animationorientation='1 0 0 -0.4position='0 4 10'/>
<!-- ROUTE information for Clock node:  [from Toucher.isActive to enabled ] [from Toucher.touchTime to startTime ] [from fraction_changed to InterpolateCrossSection.set_fraction ] -->
<TimeSensor DEF='ClockcycleInterval='5enabled='falseloop='true'/>

<!-- ROUTE information for InterpolateCrossSection node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to AnimatedCrossSectionExtrusion.set_crossSection ] -->
<CoordinateInterpolator2D DEF='InterpolateCrossSectionkey='0 0.45 0.9 1keyValue='1 1 1 -1 -1 -1 -1 1 1 1 2 2 2 -2 -1 -1 -1 1 2 2 1 1 1 -1 -1 -1 -1 1 1 1 1 1 1 -1 -1 -1 -1 1 1 1'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' InterpolateCrossSection' toField='set_fraction'/>
<Transform translation='0.25 1 0'>
<!-- ROUTE information for Toucher node:  [from isActive to Clock.enabled ] [from touchTime to Clock.startTime ] -->
<TouchSensor DEF='Toucherdescription='click & hold shape to animate Extrusion'/>

< ROUTE  fromNode=' Toucher' fromField='isActive' toNode=' Clock' toField='enabled'/>
<!-- also reset clock to restart -->
< ROUTE  fromNode=' Toucher' fromField='touchTime' toNode=' Clock' toField='startTime'/>
<Shape>
<!-- ROUTE information for AnimatedCrossSectionExtrusion node:  [from InterpolateCrossSection.value_changed to set_crossSection ] -->
<Extrusion DEF='AnimatedCrossSectionExtrusionspine='-4 0 -2 -1 0 -2 2 0 1 2 0 4'/>

<Appearance>
<Material diffuseColor='0.2 0.8 0.4'/>
</Appearance>
</Shape>
< ROUTE  fromNode=' InterpolateCrossSection' fromField='value_changed' toNode=' AnimatedCrossSectionExtrusion' toField='set_crossSection'/>
</Transform>
<Transform translation='-1.5 -1 2'>
<Billboard axisOfRotation='0 0 0'>
<Shape>
<Text string='"click & hold shape" "to animate Extrusion"'>
<FontStyle family='"SANS"justify='"MIDDLE" "MIDDLE"size='0.8'/>
</Text>
<Appearance>
<Material diffuseColor='0.8 0.4 0.2'/>
</Appearance>
</Shape>
</Billboard>
</Transform>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: AnimatedCrossSectionExtrusion, Clock, InterpolateCrossSection, Toucher

Index for Viewpoint node: Viewpoint_1
-->

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

Toucher
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
Clock
TimeSensor
enabled
SFBool

 
 
then
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
InterpolateCrossSection
CoordinateInterpolator2D
set_fraction
SFFloat

 
 
then
InterpolateCrossSection
CoordinateInterpolator2D
value_changed
MFVec2f

ROUTE
event to
(3)
AnimatedCrossSectionExtrusion
Extrusion
set_crossSection
MFVec2f
Toucher
TouchSensor
touchTime
SFTime

ROUTE
event to
(1)
Clock
TimeSensor
startTime
SFTime

 
 
then
Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(2)
InterpolateCrossSection
CoordinateInterpolator2D
set_fraction
SFFloat

 
 
then
InterpolateCrossSection
CoordinateInterpolator2D
value_changed
MFVec2f

ROUTE
event to
(3)
AnimatedCrossSectionExtrusion
Extrusion
set_crossSection
MFVec2f


Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
InterpolateCrossSection
CoordinateInterpolator2D
set_fraction
SFFloat

 
 
then
InterpolateCrossSection
CoordinateInterpolator2D
value_changed
MFVec2f

ROUTE
event to
(2)
AnimatedCrossSectionExtrusion
Extrusion
set_crossSection
MFVec2f


-->

<!-- Online at
https://www.web3d.org/x3d/content/examples/Basic/development/CoordinateInterpolator2dExampleIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Basic/development/CoordinateInterpolator2dExample.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. -->