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=' Castle Game Engine view3dscene Issue: tovrmlx3d.exe ROUTE validation confused by similar DEF names OrbSpin, OrbSpinner '/>
  7            <meta name='creatorcontent='Figure 27.3, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
  8            <meta name='referencecontent='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch27/27fig03.htm'/>
  9            <meta name='translatorcontent='Don Brutzman'/>
 10            <meta name='createdcontent='26 October 2000'/>
 11            <meta name='modifiedcontent='7 April 2024'/>
 12            <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.'/>
 13            <meta name='identifiercontent='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/Figure27_3CollisionDetectionSpinningOrb.x3d'/>
 14            <meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
 15            <meta name='licensecontent='../../license.html'/>
 16       </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
-->
 17       <Scene>
 18            <WorldInfo title='Figure27_3CollisionDetectionSpinningOrb.x3d'/>
 19            <Viewpoint description='Zoom in on the orb to trigger the Collision nodeposition='0 2 10'/>
 20            <Viewpoint description='Close-up viewpoint by the orb that triggers the Collision nodeposition='0 0.8 2.5'/>
 21            <!-- Note NavigationInfo avatarSize affects collision range -->
 22            <NavigationInfo avatarSize='2 1 0.5headlight='falsespeed='2type='"WALK" "EXAMINE" "ANY"'/>
 23            <Group>
 24                 <Transform translation='0 0 2.5'>
 25 
 26                 </Transform>
 27                 <Transform translation='0 0 -2.5'>
 28                      <Inline USE='Floor'/>
 29                 </Transform>
 30 
               <!-- ROUTE information for OrbCollide node:  [from collideTime to Clock.set_startTime ] [from collideTime to Wispy.set_startTime ] -->
               <Collision DEF='OrbCollide'>
 31                      <!-- Note that proxy geometry is not rendered -->
 32 
                    <!-- Transform ProxyGeometryTransform is a DEF node that has 1 USE node: USE_1 -->
                    <Transform DEF='ProxyGeometryTransformcontainerField='proxytranslation='0 0.6 0'>
 33                           <Shape>
 34                                <Box size='0.4 1.2 0.4'/>
 35                                <Appearance>
 36                                     <Material transparency='0.8'/>
 37                                </Appearance>
 38                           </Shape>
 39                      </Transform>
 40                      <!-- If you want to also see the simplifying proxy geometry, DEF/USE it outside of the proxy containerField subtree. -->
 41                      <Transform USE='ProxyGeometryTransform'/>
 42                      <!-- Rest of collidable scene follows. -->
 43 
                    <!-- ROUTE information for OrbSpin node:  [from OrbSpinner.value_changed to set_rotation ] -->
                    <Transform DEF='OrbSpintranslation='0 1 0'>
 44                           <PointLight ambientIntensity='0.2color='0.7 0.5 0location='0.3 0 0radius='10'/>
 45                           <Shape>
 46                                <Appearance>
 47                                     <ImageTexture   url=' "fire.jpg " "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/fire.jpg " '/>
 48                                     <!-- alternate emissive material as backup, comparable to fire.jpg texturing -->
 49                                     <Material emissiveColor='0.8 0.4 0.1'/>
 50                                </Appearance>
 51                                <Sphere radius='0.2'/>
 52                           </Shape>
 53                      </Transform>
 54                 </Collision>
 55                 <Shape>
 56 
                    <!-- Appearance PedestalColor is a DEF node that has 1 USE node: USE_1 -->
                    <Appearance DEF='PedestalColor'>
 57                           <Material diffuseColor='0.7 0.6 0.5'/>
 58                      </Appearance>
 59                      <IndexedFaceSet coordIndex='0 1 4 -1 1 2 4 -1 2 3 4 -1 3 0 4 -1'>
 60                           <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'/>
 61                      </IndexedFaceSet>
 62                 </Shape>
 63                 <Transform translation='0 0.015 0'>
 64                      <Shape>
 65                           <Appearance USE='PedestalColor'/>
 66                           <Box size='0.4 0.03 0.4'/>
 67                      </Shape>
 68                 </Transform>
 69            </Group>
 70 
          <!-- ROUTE information for WispyAmp node:  [from WispyVolume.value_changed to set_intensity ] -->
          <Sound DEF='WispyAmpintensity='0.5'>
 71 
               <!-- 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" '/>
 72            </Sound>
 73            <!-- Animation clock -->
 74 
          <!-- 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'/>
 75            < ROUTE  fromNode='OrbCollide' fromField='collideTime' toNode='Clock' toField='set_startTime'/>
 76            < ROUTE  fromNode='OrbCollide' fromField='collideTime' toNode='Wispy' toField='set_startTime'/>
 77            <!-- Orb rotation animation and scalar-driven volume control -->
 78 
          <!-- 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'/>
 79            < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='OrbSpinner' toField='set_fraction'/>
 80            < ROUTE  fromNode='OrbSpinner' fromField='value_changed' toNode='OrbSpin' toField='set_rotation'/>
 81 
          <!-- 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'/>
 82            < ROUTE  fromNode='Clock' fromField='fraction_changed' toNode='WispyVolume' toField='set_fraction'/>
 83            < ROUTE  fromNode='WispyVolume' fromField='value_changed' toNode='WispyAmp' toField='set_intensity'/>
 84       </Scene>
 85  </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='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. -->