X3D Model Documentation: AnimatedGrid.x3d go to online X3D Example Archives model page

  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='title' content=' AnimatedGrid.x3d '/>
  6            <meta name='description' content='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='creator' content='John L. Moreland'/>
  8            <meta name='translator' content='Don Brutzman'/>
  9            <meta name='created' content='1 July 1998'/>
 10            <meta name='translated' content='2 February 2014'/>
 11            <meta name='modified' content='20 October 2019'/>
 12            <meta name='reference' content='originals/animgrid.wrl'/>
 13            <meta name='reference' content='http://www.siggraph.org/s98'/>
 14            <meta name='reference' content=' http://www.siggraph.org/s98/conference/courses/18.html '/>
 15            <meta name='reference' content=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/slides/mt0495.htm '/>
 16            <meta name='reference' content=' http://www.sdsc.edu/~moreland/courses/Siggraph98/vrml97/vrml97.htm '/>
 17            <meta name='reference' content=' https://www.web3d.org/x3d/content/examples/X3dResources.html '/>
 18            <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/AnimatedGrid.x3d '/>
 19            <meta name='generator' content=' Vrml97ToX3dNist, http://ovrt.nist.gov/v2_x3d.html '/>
 20            <meta name='generator' content='X3D-Edit, https://www.web3d.org/x3d/tools/X3D-Edit'/>
 21            <meta name='license' content='../license.html'/>
 22       </head>
<!--

Event Graph ROUTE Table shows event connections.

--> <!-- to top DEF nodes index: 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 view' orientation='1.0 0.0 0.0 -0.83' position='0.0 12.0 12.0'/>
 26            <NavigationInfo headlight='false' type='"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='Grids' whichChoice='0'>
 30  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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  go to online X3D Example Archives model page                <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='Clock' cycleInterval='2.0' loop='true' startTime='1.0' enabled='true'/>
 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_changed' type='SFInt32' accessType='outputOnly'/>
 44                 <field name='numberOfChoices' type='SFInt32' value='10' accessType='initializeOnly'/>
 45                 <field name='set_fraction' type='SFFloat' accessType='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 DEF nodes index: Clock, Grids, Switcher

Index for Viewpoint node: Viewpoint_1

-->

X3D Tooltips element index: to top DirectionalLight, field, head, Inline, meta, NavigationInfo, ROUTE, Scene, Script, Switch, TimeSensor, Viewpoint, WorldInfo, X3D,
plus documentation for accessType definitions, type definitions, XML data types, and field types

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

Clock
TimeSensor
fraction_changed
SFFloat
→
ROUTE
event to
(1)
Switcher
Script
set_fraction
SFFloat
then
from
same
node
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! 😀

-->
go to online X3D Example Archives model page <!-- Online at
https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/AnimatedGridIndex.html -->
<!-- SourceForge version control Version control at    
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Siggraph98Course/AnimatedGrid.x3d -->

<!-- Color-coding 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. -->