X3D Model Documentation: Figure22_4BackgroundBinding.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <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'>
  4       <head>
  5            <meta name='titlecontent='Figure22_4BackgroundBinding.x3d'/>
  6            <meta name='creatorcontent='Figure 22.4, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
  7            <meta name='referencecontent='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch22/22fig04.htm'/>
  8            <meta name='translatorcontent='Don Brutzman'/>
  9            <meta name='createdcontent='22 August 2000'/>
 10            <meta name='modifiedcontent='20 October 2019'/>
 11            <meta name='descriptioncontent='Backgrounds bound and unbound by touching a red cube or a blue sphere.'/>
 12            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter22Background/Figure22_4BackgroundBinding.x3d'/>
 13            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 14            <meta name='licensecontent='../../license.html'/>
 15       </head>
<!--

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

<!-- to top Index for DEF nodes: AlternateBackground1, AlternateBackground2, TouchBox, TouchSphere
-->
 16       <Scene>
 17            <!-- Note that navigation mode doesn't matter much here, since you cannot approach the backround, it always stays at maximum (horizon) distance -->
 18            <!-- At least EXAMINE mode lets you easily look up/down/around. -->
 19            <WorldInfo title='Figure22_4BackgroundBinding.x3d'/>
 20            <Group>
 21                 <Background groundAngle='1.309 1.570796groundColor='0.1 0.1 0 0.4 0.25 0.2 0.6 0.6 0.6skyAngle='1.309 1.571skyColor='0 0.2 0.7 0 0.5 1 1 1 1'/>
 22 
               <!-- ROUTE information for AlternateBackground1 node:  [from TouchBox.isActive to set_bind ] -->
               <Background DEF='AlternateBackground1groundAngle='1.309 1.570796groundColor='0.1 0.1 0 0.5 0.25 0.2 0.6 0.6 0.2skyAngle='1.309 1.571skyColor='1 0 0 1 0.4 0 1 1 0'/>
 23 
               <!-- ROUTE information for AlternateBackground2 node:  [from TouchSphere.isActive to set_bind ] -->
               <Background DEF='AlternateBackground2groundAngle='1.309 1.570796groundColor='0 0 0.1 0 0.1 0.3 0.3 0.3 0.6skyAngle='1.309 1.571skyColor='1 0 0.8 0.5 0 0.8 0 0 0.8'/>
 24            </Group>
 25            <!-- Shapes to act as buttons -->
 26            <Transform translation='2 0 0'>
 27                 <Shape>
 28                      <Appearance>
 29                           <Material diffuseColor='1 0 0'/>
 30                      </Appearance>
 31                      <Box/>
 32                 </Shape>
 33 
               <!-- ROUTE information for TouchBox node:  [from isActive to AlternateBackground1.set_bind ] -->
               <TouchSensor DEF='TouchBoxdescription='Alternate reddish-orange background'/>
 34            </Transform>
 35            <Transform translation='-2 0 0'>
 36                 <Shape>
 37                      <Appearance>
 38                           <Material diffuseColor='0 0 0.8'/>
 39                      </Appearance>
 40                      <Sphere/>
 41                 </Shape>
 42 
               <!-- ROUTE information for TouchSphere node:  [from isActive to AlternateBackground2.set_bind ] -->
               <TouchSensor DEF='TouchSpheredescription='Alternate blueish-purple background'/>
 43            </Transform>
 44            < ROUTE  fromNode='TouchBox' fromField='isActive' toNode='AlternateBackground1' toField='set_bind'/>
 45            < ROUTE  fromNode='TouchSphere' fromField='isActive' toNode='AlternateBackground2' toField='set_bind'/>
 46       </Scene>
 47  </X3D>
<!--

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

<!-- to top Index for DEF nodes: AlternateBackground1, AlternateBackground2, TouchBox, TouchSphere
-->
X3D Tooltips element index: Appearance, Background, Box, Group, head, Material, meta, ROUTE, Scene, Shape, Sphere, TouchSensor, Transform, 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.

TouchBox
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
AlternateBackground1
Background
set_bind
SFBool

TouchSphere
TouchSensor
isActive
SFBool

ROUTE
event to
(1)
AlternateBackground2
Background
set_bind
SFBool
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/Chapter22Background/Figure22_4BackgroundBindingIndex.html -->
<!-- Version control at
https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter22Background/Figure22_4BackgroundBinding.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. -->