X3D Model Documentation: PointSetExample.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2  <!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
  3  <X3D profile='Immersive' version='3.3 xmlns:xsd='https://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent=' PointSetExample.x3d '/>
  6            <meta name='descriptioncontent='Way points for the animated shark Lucy traversing the tank.'/>
  7            <meta name='creatorcontent='Tim McLean'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='14 June 2020'/>
 10            <meta name='translatedcontent='14 June 2020'/>
 11            <meta name='modifiedcontent='14 July 2025'/>
 12            <meta name='referencecontent='http://faculty.nps.edu/brutzman/kelp'/>
 13            <meta name='referencecontent=' https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/SharkLucyLocale.x3d '/>
 14            <meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/PointSetExample.x3d '/>
 15            <meta name='generatorcontent='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 16            <meta name='licensecontent='../license.html'/>
 17       </head>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: _0, _4, SHARK1_CLOCK, SHARK1_ORIENTATION, SHARK1_POSITION, sharkSwimmingInTankTrigger_5, TurnPoints

Index for Viewpoint node: Viewpoint_1

-->
 18       <Scene>
 19            <WorldInfo title='PointSetExample.x3d'/>
 20            <Background/>
 21            <Viewpoint description='Book Vieworientation='0.939 0.335 0.075 -0.57position='-0.89 1.91 9.26'/>
 22 
          <!-- ROUTE information for _0 node:  [from SHARK1_POSITION.value_changed to set_translation ] [from SHARK1_ORIENTATION.value_changed to set_rotation ] -->
          <Transform DEF='_0translation='0.0 -8.0 -1.0'>
 23                 <Inline   url=' "../KelpForestExhibit/SharkLucy.x3d" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/SharkLucy.x3d" "../KelpForestExhibit/SharkLucy.wrl" "https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/KelpForestExhibit/SharkLucy.wrl" '/>
 24                 <Group>
 25 
                    <!-- ROUTE information for SHARK1_CLOCK node:  [from sharkSwimmingInTankTrigger_5.startTime to set_startTime ] [from fraction_changed to SHARK1_POSITION.set_fraction ] [from fraction_changed to SHARK1_ORIENTATION.set_fraction ] -->
                    <TimeSensor DEF='SHARK1_CLOCKcycleInterval='220.0loop='trueenabled='true'/>
 26 
                    <!-- ROUTE information for SHARK1_POSITION node:  [from SHARK1_CLOCK.fraction_changed to set_fraction ] [from value_changed to _0.set_translation ] -->
                    <PositionInterpolator DEF='SHARK1_POSITIONkey='0.0 0.048 0.112 0.155 0.184 0.263 0.3 0.342 0.375 0.404 0.457 0.497 0.57 0.65 0.702 0.796 0.888 0.938 1.0keyValue='0.0 -7.0 -1.0 -1.75 -7.0 -0.5 -4.0 -7.0 0.5 -5.0 -6.5 1.5 -5.5 -6.25 0.75 -5.25 -5.5 -2.25 -4.25 -5.0 -3.25 -2.75 -4.5 -3.75 -1.5 -4.5 -4.0 -0.5 -4.25 -4.5 1.5 -3.75 -4.75 3.0 -3.75 -4.5 5.75 -4.5 -4.5 8.75 -4.5 -4.0 9.25 -4.5 -2.25 7.5 -5.5 0.0 4.0 -6.5 -0.25 2.25 -7.0 -0.25 0.0 -7.0 -1.0'/>
 27 
                    <!-- ROUTE information for SHARK1_ORIENTATION node:  [from SHARK1_CLOCK.fraction_changed to set_fraction ] [from value_changed to _0.set_rotation ] -->
                    <OrientationInterpolator DEF='SHARK1_ORIENTATIONkey='0.0 0.048 0.112 0.155 0.184 0.263 0.3 0.342 0.375 0.404 0.457 0.497 0.57 0.65 0.702 0.796 0.888 0.938 1.0keyValue='0.0 1.0 0.0 3.4208 0.0 1.0 0.0 3.5605 0.1504 0.986 0.0717 4.0208 0.1095 0.9918 -0.0658 2.0667 -0.1207 0.9836 0.134 1.4825 -0.1565 0.9125 0.3779 0.8522 -0.1099 0.7118 0.6937 0.4379 0.0 1.0 0.0 0.192 -0.0956 0.8656 0.4916 0.4418 -0.0606 0.4959 0.8663 0.2802 0.0 1.0 0.0 6.161 0.0 0.0 -1.0 0.2618 0.0 1.0 0.0 6.0388 0.0 1.0 0.0 5.236 -0.1388 0.9878 -0.0707 4.0742 -0.1392 0.9903 0.0 3.1416 -0.1305 0.9911 0.0265 3.0 0.0 1.0 0.0 2.827 0.0 1.0 0.0 3.4208'/>
 28                 </Group>
 29            </Transform>
 30            <!-- TODO move PointSet to top -->
 31            <Transform>
 32                 <Shape>
 33                      <Appearance>
 34                           <Material emissiveColor='1 1 0'/>
 35                      </Appearance>
 36                      <PointSet>
 37                           <Coordinate DEF='TurnPointspoint='0.0 -7.0 -1.0 -1.75 -7.0 -0.5 -4.0 -7.0 0.5 -5.0 -6.5 1.5 -5.5 -6.25 0.75 -5.25 -5.5 -2.25 -4.25 -5.0 -3.25 -2.75 -4.5 -3.75 -1.5 -4.5 -4.0 -0.5 -4.25 -4.5 1.5 -3.75 -4.75 3.0 -3.75 -4.5 5.75 -4.5 -4.5 8.75 -4.5 -4.0 9.25 -4.5 -2.25 7.5 -5.5 0.0 4.0 -6.5 -0.25 2.25 -7.0 -0.25 0.0 -7.0 -1.0'/>
 38                      </PointSet>
 39                 </Shape>
 40            </Transform>
 41 
          <!-- ROUTE information for _4 node:  [from sharkSwimmingInTankTrigger_5.firstTime to set_enabled ] [from time to sharkSwimmingInTankTrigger_5.triggerIn ] -->
          <TimeSensor DEF='_4loop='truecycleInterval='1.0enabled='true'/>
 42 
          <!-- ROUTE information for sharkSwimmingInTankTrigger_5 node:  [from _4.time to triggerIn ] [from startTime to SHARK1_CLOCK.set_startTime ] [from firstTime to _4.set_enabled ] -->
          <Script DEF='sharkSwimmingInTankTrigger_5'>
 43                 <field name='triggerIntype='SFTimeaccessType='inputOnly'/>
 44                 <field name='startTimetype='SFTimeaccessType='outputOnly'/>
 45                 <field name='firstTimetype='SFBoolaccessType='outputOnly'/>
  <![CDATA[
      
ecmascript:

function triggerIn (value, time)
{
	startTime = value;
	firstTime = false;
}

    
]]>
 47            </Script>
 48            < ROUTE  fromNode='sharkSwimmingInTankTrigger_5' fromField='startTime' toNode='SHARK1_CLOCK' toField='set_startTime'/>
 49            < ROUTE  fromNode='SHARK1_CLOCK' fromField='fraction_changed' toNode='SHARK1_POSITION' toField='set_fraction'/>
 50            < ROUTE  fromNode='SHARK1_CLOCK' fromField='fraction_changed' toNode='SHARK1_ORIENTATION' toField='set_fraction'/>
 51            < ROUTE  fromNode='SHARK1_POSITION' fromField='value_changed' toNode='_0' toField='set_translation'/>
 52            < ROUTE  fromNode='SHARK1_ORIENTATION' fromField='value_changed' toNode='_0' toField='set_rotation'/>
 53            < ROUTE  fromNode='sharkSwimmingInTankTrigger_5' fromField='firstTime' toNode='_4' toField='set_enabled'/>
 54            < ROUTE  fromNode='_4' fromField='time' toNode='sharkSwimmingInTankTrigger_5' toField='triggerIn'/>
 55       </Scene>
 56  </X3D>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: _0, _4, SHARK1_CLOCK, SHARK1_ORIENTATION, SHARK1_POSITION, sharkSwimmingInTankTrigger_5, TurnPoints

Index for Viewpoint node: Viewpoint_1

-->
X3D Tooltips element index: to top Appearance, Background, Coordinate, field, Group, head, Inline, Material, meta, OrientationInterpolator, PointSet, PositionInterpolator, ROUTE, Scene, Script, Shape, TimeSensor, Transform, Viewpoint, WorldInfo, X3D,
plus documentation for accessType definitions, type definitions, XML data types, and field types

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

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

SHARK1_CLOCK
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
SHARK1_POSITION
PositionInterpolator
set_fraction
SFFloat
then
from
same
node
SHARK1_POSITION
PositionInterpolator
value_changed
SFVec3f
→
ROUTE
event to
(2)
_0
Transform
set_translation
SFVec3f
SHARK1_CLOCK
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
SHARK1_ORIENTATION
OrientationInterpolator
set_fraction
SFFloat
then
from
same
node
SHARK1_ORIENTATION
OrientationInterpolator
value_changed
SFRotation
→
ROUTE
event to
(2)
_0
Transform
set_rotation
SFRotation

The following ROUTE chain begins an event-routing loop! Loop occurs at nodeDepth=4.
 
ROUTE _4.time TO sharkSwimmingInTankTrigger_5.triggerIn
_4
TimeSensor
time
SFTime
→
ROUTE
event to
(1)
sharkSwimmingInTankTrigger_5
Script
triggerIn
SFTime
then
from
same
node
sharkSwimmingInTankTrigger_5
Script
firstTime
SFBool
→
ROUTE
event to
(2)
_4
TimeSensor
set_enabled
SFBool
then
from
same
node
_4
TimeSensor
time
SFTime
→
ROUTE
event to
(3)
sharkSwimmingInTankTrigger_5
Script
triggerIn
SFTime
then
from
same
node
sharkSwimmingInTankTrigger_5
Script
firstTime
SFBool
→
ROUTE
event to
(4)
_4
TimeSensor
set_enabled
SFBool
then
from
same
node
_4
TimeSensor
time
SFTime
→
ROUTE
event to
(5)
sharkSwimmingInTankTrigger_5
Script
triggerIn
SFTime
then
from
same
node
sharkSwimmingInTankTrigger_5
Script
firstTime
SFBool
→
ROUTE
event to
(6)
_4
TimeSensor
set_enabled
SFBool
then
from
same
node
_4
TimeSensor
time
SFTime
→
ROUTE
event to
(7)
sharkSwimmingInTankTrigger_5
Script
triggerIn
SFTime
  then
from
same
node
sharkSwimmingInTankTrigger_5
Script
startTime
SFTime
→
ROUTE
event to
(6)
SHARK1_CLOCK
TimeSensor
set_startTime
SFTime
then
from
same
node
SHARK1_CLOCK
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(7)
SHARK1_POSITION
PositionInterpolator
set_fraction
SFFloat
  then
from
same
node
SHARK1_CLOCK
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(7)
SHARK1_ORIENTATION
OrientationInterpolator
set_fraction
SFFloat
  then
from
same
node
sharkSwimmingInTankTrigger_5
Script
startTime
SFTime
→
ROUTE
event to
(4)
SHARK1_CLOCK
TimeSensor
set_startTime
SFTime
then
from
same
node
SHARK1_CLOCK
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(5)
SHARK1_POSITION
PositionInterpolator
set_fraction
SFFloat
then
from
same
node
SHARK1_POSITION
PositionInterpolator
value_changed
SFVec3f
→
ROUTE
event to
(6)
_0
Transform
set_translation
SFVec3f
  then
from
same
node
SHARK1_CLOCK
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(5)
SHARK1_ORIENTATION
OrientationInterpolator
set_fraction
SFFloat
then
from
same
node
SHARK1_ORIENTATION
OrientationInterpolator
value_changed
SFRotation
→
ROUTE
event to
(6)
_0
Transform
set_rotation
SFRotation
  then
from
same
node
sharkSwimmingInTankTrigger_5
Script
startTime
SFTime
→
ROUTE
event to
(2)
SHARK1_CLOCK
TimeSensor
set_startTime
SFTime
then
from
same
node
SHARK1_CLOCK
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(3)
SHARK1_POSITION
PositionInterpolator
set_fraction
SFFloat
then
from
same
node
SHARK1_POSITION
PositionInterpolator
value_changed
SFVec3f
→
ROUTE
event to
(4)
_0
Transform
set_translation
SFVec3f
  then
from
same
node
SHARK1_CLOCK
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(3)
SHARK1_ORIENTATION
OrientationInterpolator
set_fraction
SFFloat
then
from
same
node
SHARK1_ORIENTATION
OrientationInterpolator
value_changed
SFRotation
→
ROUTE
event to
(4)
_0
Transform
set_rotation
SFRotation


Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets.
Have fun with X3D! 😀

-->
<!-- Online at
https://www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/PointSetExampleIndex.html -->
<!-- SourceForge version control Version control at    
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/X3dForWebAuthors/Chapter06GeometryPointsLinesPolygons/PointSetExample.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode DEF='idNamefield='value'/> matches XML terminology <XmlElement DEF='idNameattribute='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. -->