X3D Model Documentation: AnimatedGrid.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='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  4       <head>
  5            <meta name='titlecontent='AnimatedGrid.x3d'/>
  6            <meta name='descriptioncontent='Animated grid world illustrates the use of a script to change the whichChoice field of a Switch node. When animated, this enables switching among different pieces of geometry, such as the separate ElevationGrid scenes shown in this example.'/>
  7            <meta name='creatorcontent='John L. Moreland'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='1 July 1998'/>
 10            <meta name='translatedcontent='2 February 2014'/>
 11            <meta name='modifiedcontent='20 October 2019'/>
 12            <meta name='referencecontent='originals/animgrid.wrl'/>
 13            <meta name='referencecontent='http://www.siggraph.org/s98'/>
 14            <meta name='referencecontent='http://www.siggraph.org/s98/conference/courses/18.html'/>
 15            <meta name='referencecontent='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0495.htm'/>
 16            <meta name='referencecontent='http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm'/>
 17            <meta name='referencecontent='https://www.web3d.org/x3d/content/examples/X3dResources.html'/>
 18            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/AnimatedGrid.x3d'/>
 19            <meta name='generatorcontent='Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html'/>
 20            <meta name='generatorcontent='X3D-Edit, https://savage.nps.edu/X3D-Edit'/>
 21            <meta name='licensecontent='../license.html'/>
 22       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Clock, Grids, Switcher

Index for Viewpoint node: Viewpoint_1
-->
 23       <Scene>
 24            <WorldInfo info='"Copyright (c) 1998, John L. Moreland"title='Animated grid'/>
 25            <Viewpoint description='Entry vieworientation='1.0 0.0 0.0 -0.83position='0.0 12.0 12.0'/>
 26            <NavigationInfo headlight='falsetype='"EXAMINE"'/>
 27            <DirectionalLight direction='1.0 -1.0 -1.0'/>
 28            <DirectionalLight direction='-1.0 1.0 1.0'/>
 29 
          <!-- ROUTE information for Grids node:  [from Switcher.choice_changed to set_whichChoice ] -->
          <Switch DEF='GridswhichChoice='0'>
 30                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain00.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain00.x3d" "Terrain00.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain00.wrl" '/>
 31                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain01.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain01.x3d" "Terrain01.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain01.wrl" '/>
 32                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain02.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain02.x3d" "Terrain02.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain02.wrl" '/>
 33                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain03.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain03.x3d" "Terrain03.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain03.wrl" '/>
 34                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain04.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain04.x3d" "Terrain04.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain04.wrl" '/>
 35                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain05.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain05.x3d" "Terrain05.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain05.wrl" '/>
 36                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain06.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain06.x3d" "Terrain06.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain06.wrl" '/>
 37                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain07.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain07.x3d" "Terrain07.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain07.wrl" '/>
 38                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain08.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain08.x3d" "Terrain08.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain08.wrl" '/>
 39                 <Inline bboxSize='14.0 5.0 14.0'   url=' "Terrain09.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain09.x3d" "Terrain09.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/Terrain09.wrl" '/>
 40            </Switch>
 41 
          <!-- ROUTE information for Clock node:  [from fraction_changed to Switcher.set_fraction ] -->
          <TimeSensor DEF='ClockcycleInterval='2.0loop='truestartTime='1.0'/>
 42 
          <!-- ROUTE information for Switcher node:  [from Clock.fraction_changed to set_fraction ] [from choice_changed to Grids.set_whichChoice ] -->
          <Script DEF='Switcher'>
 43                 <field name='choice_changedtype='SFInt32accessType='outputOnly'/>
 44                 <field name='numberOfChoicestype='SFInt32value='10accessType='initializeOnly'/>
 45                 <field name='set_fractiontype='SFFloataccessType='inputOnly'/>
  <![CDATA[
      
ecmascript:
    function set_fraction( frac, stamp ) {
            choice_changed = frac * numberOfChoices;
    }

    
]]>
 47            </Script>
 48            < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='Switcher' toField='set_fraction'/>
 49            < ROUTE  fromNode='Switcher' fromField='choice_changed' toNode='Grids' toField='set_whichChoice'/>
 50       </Scene>
 51  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->

<!-- to top Index for DEF nodes: Clock, Grids, Switcher

Index for Viewpoint node: Viewpoint_1
-->
X3D Tooltips element index: DirectionalLight, field, head, Inline, meta, NavigationInfo, ROUTE, Scene, Script, Switch, TimeSensor, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

Clock
TimeSensor
fraction_changed
SFFloat

ROUTE
event to
(1)
Switcher
Script
set_fraction
SFFloat
then
 
 
 
Switcher
Script
choice_changed
SFInt32

ROUTE
event to
(2)
Grids
Switch
set_whichChoice
SFInt32

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/Vrml2Sourcebook/Siggraph98Course/AnimatedGridIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/AnimatedGrid.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. -->