X3D Model Documentation: Figure27_3CollisionDetectionSpinningOrb.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='Immersive' 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='Figure27_3CollisionDetectionSpinningOrb.x3d'/>
  6            <meta name=' TODO content=' fix NavigationInfo WALK mode inconsistencies '/>
  7            <meta name=' TODO content=' Castle Game Engine view3dscene Issue: tovrmlx3d.exe ROUTE validation confused by similar DEF names OrbSpin, OrbSpinner '/>
  8            <meta name='creatorcontent='Figure 27.3, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
  9            <meta name='referencecontent='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch27/27fig03.htm'/>
 10            <meta name='translatorcontent='Don Brutzman'/>
 11            <meta name='createdcontent='26 October 2000'/>
 12            <meta name='modifiedcontent='7 April 2024'/>
 13            <meta name='descriptioncontent='An orb that animates (for a single revolution) when the viewer collides with its box proxy shape. Walk towards the orb by using the up-arrow key.'/>
 14            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/Figure27_3CollisionDetectionSpinningOrb.x3d'/>
 15            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 16            <meta name='licensecontent='../../license.html'/>
 17       </head>
<!--

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

<!-- to top Index for DEF nodes: Clock, Floor, OrbCollide, OrbSpin, OrbSpinner, PedestalColor, ProxyGeometryTransform, Wispy, WispyAmp, WispyVolume

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
 18       <Scene>
 19            <WorldInfo title='Figure27_3CollisionDetectionSpinningOrb.x3d'/>
 20            <Viewpoint description='Zoom in on the orb to trigger the Collision nodeposition='0 2 10'/>
 21            <Viewpoint description='Close-up viewpoint by the orb that triggers the Collision nodeposition='0 0.8 2.5'/>
 22            <!-- Note NavigationInfo avatarSize affects collision range -->
 23            <NavigationInfo avatarSize='2 1 0.5headlight='falsespeed='2type='"WALK" "EXAMINE" "ANY"'/>
 24            <Group>
 25                 <Transform translation='0 0 2.5'>
 26 
 27                 </Transform>
 28                 <Transform translation='0 0 -2.5'>
 29                      <Inline USE='Floor'/>
 30                 </Transform>
 31 
               <!-- ROUTE information for OrbCollide node:  [from collideTime to Clock.set_startTime ] [from collideTime to Wispy.set_startTime ] -->
               <Collision DEF='OrbCollide'>
 32                      <!-- Note that proxy geometry is not rendered -->
 33 
                    <!-- Transform ProxyGeometryTransform is a DEF node that has 1 USE node: USE_1 -->
                    <Transform DEF='ProxyGeometryTransformcontainerField='proxytranslation='0 0.6 0'>
 34                           <Shape>
 35                                <Box size='0.4 1.2 0.4'/>
 36                                <Appearance>
 37                                     <Material transparency='0.8'/>
 38                                </Appearance>
 39                           </Shape>
 40                      </Transform>
 41                      <!-- If you want to also see the simplifying proxy geometry, DEF/USE it outside of the proxy containerField subtree. -->
 42                      <Transform USE='ProxyGeometryTransform'/>
 43                      <!-- Rest of collidable scene follows. -->
 44 
                    <!-- ROUTE information for OrbSpin node:  [from OrbSpinner.value_changed to set_rotation ] -->
                    <Transform DEF='OrbSpintranslation='0 1 0'>
 45                           <PointLight ambientIntensity='0.2color='0.7 0.5 0location='0.3 0 0radius='10'/>
 46                           <Shape>
 47                                <Appearance>
 48                                     <ImageTexture   url=' "fire.jpg " "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/fire.jpg " '/>
 49                                     <!-- alternate emissive material as backup, comparable to fire.jpg texturing -->
 50                                     <Material emissiveColor='0.8 0.4 0.1'/>
 51                                </Appearance>
 52                                <Sphere radius='0.2'/>
 53                           </Shape>
 54                      </Transform>
 55                 </Collision>
 56                 <Shape>
 57 
                    <!-- Appearance PedestalColor is a DEF node that has 1 USE node: USE_1 -->
                    <Appearance DEF='PedestalColor'>
 58                           <Material diffuseColor='0.7 0.6 0.5'/>
 59                      </Appearance>
 60                      <IndexedFaceSet coordIndex='0 1 4 -1 1 2 4 -1 2 3 4 -1 3 0 4 -1'>
 61                           <Coordinate point='-0.12 0.03 0.12 0.12 0.03 0.12 0.12 0.03 -0.12 -0.12 0.03 -0.12 0.0 0.63 0.0'/>
 62                      </IndexedFaceSet>
 63                 </Shape>
 64                 <Transform translation='0 0.015 0'>
 65                      <Shape>
 66                           <Appearance USE='PedestalColor'/>
 67                           <Box size='0.4 0.03 0.4'/>
 68                      </Shape>
 69                 </Transform>
 70            </Group>
 71 
          <!-- ROUTE information for WispyAmp node:  [from WispyVolume.value_changed to set_intensity ] -->
          <Sound DEF='WispyAmpintensity='0.5'>
 72 
               <!-- ROUTE information for Wispy node:  [from OrbCollide.collideTime to set_startTime ] -->
               <AudioClip DEF='Wispydescription='droneloop='true'   url=' "drone1.wav" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/drone1.wav" '/>
 73            </Sound>
 74            <!-- Animation clock -->
 75 
          <!-- ROUTE information for Clock node:  [from OrbCollide.collideTime to set_startTime ] [from fraction_changed to OrbSpinner.set_fraction ] [from fraction_changed to WispyVolume.set_fraction ] -->
          <TimeSensor DEF='ClockcycleInterval='8'/>
 76            < ROUTE  fromNode='OrbCollide' fromField='collideTime' toNode='Clock' toField='set_startTime'/>
 77            < ROUTE  fromNode='OrbCollide' fromField='collideTime' toNode='Wispy' toField='set_startTime'/>
 78            <!-- Orb rotation animation and scalar-driven volume control -->
 79 
          <!-- ROUTE information for OrbSpinner node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to OrbSpin.set_rotation ] -->
          <OrientationInterpolator DEF='OrbSpinnerkey='0 0.5 1keyValue='0 1 0 0.0 0 1 0 3.14 0 1 0 6.28'/>
 80            < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='OrbSpinner' toField='set_fraction'/>
 81            < ROUTE  fromNode='OrbSpinner' fromField='value_changed' toNode='OrbSpin' toField='set_rotation'/>
 82 
          <!-- ROUTE information for WispyVolume node:  [from Clock.fraction_changed to set_fraction ] [from value_changed to WispyAmp.set_intensity ] -->
          <ScalarInterpolator DEF='WispyVolumekey='0 0.1 0.9 1keyValue='0 0.6 0.6 0'/>
 83            < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='WispyVolume' toField='set_fraction'/>
 84            < ROUTE  fromNode='WispyVolume' fromField='value_changed' toNode='WispyAmp' toField='set_intensity'/>
 85       </Scene>
 86  </X3D>
<!--

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

<!-- to top Index for DEF nodes: Clock, Floor, OrbCollide, OrbSpin, OrbSpinner, PedestalColor, ProxyGeometryTransform, Wispy, WispyAmp, WispyVolume

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
X3D Tooltips element index: Appearance, AudioClip, Box, Collision, Coordinate, Group, head, ImageTexture, IndexedFaceSet, Inline, Material, meta, NavigationInfo, OrientationInterpolator, PointLight, ROUTE, ScalarInterpolator, Scene, Shape, Sound, Sphere, TimeSensor, Transform, Viewpoint, WorldInfo, X3D, accessType and type, XML data types, field types

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

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

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