<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<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 ' >
<head>
<meta name='titlecontent='Figure27_3CollisionDetectionSpinningOrb.x3d'/>
<meta name='TODO Castle Game Engine view3dscene Issuecontent='tovrmlx3d.exe ROUTE validation confused by similar DEF names OrbSpin, OrbSpinner'/>
<meta name='creatorcontent='Figure 27.3, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/>
<meta name='referencecontent=' http://www.wiley.com/legacy/compbooks/vrml2sbk/ch27/27fig03.htm '/>
<meta name='translatorcontent='Don Brutzman'/>
<meta name='createdcontent='26 October 2000'/>
<meta name='modifiedcontent='20 October 2019'/>
<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.'/>
<meta name='identifiercontent=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/Figure27_3CollisionDetectionSpinningOrb.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Clock, Floor, OrbCollide, OrbSpin, OrbSpinner, PedestalColor, ProxyGeometryTransform, Wispy, WispyAmp, WispyVolume

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->
<Scene>
<WorldInfo title='Figure27_3CollisionDetectionSpinningOrb.x3d'/>
<Viewpoint description='Zoom in on the orb to trigger the Collision nodeposition='0 2 10'/>
<Viewpoint description='Close-up viewpoint by the orb that triggers the Collision nodeposition='0 0.8 2.5'/>
<!-- Note NavigationInfo avatarSize affects collision range -->
<NavigationInfo avatarSize='2 1 0.5headlight='falsespeed='2type='"WALK" "EXAMINE" "ANY"'/>
<Group>
<Transform translation='0 0 2.5'> </Transform>
<Transform translation='0 0 -2.5'>
<Inline USE=' Floor'/>
</Transform>
<!-- ROUTE information for OrbCollide node:  [from collideTime to Clock.set_startTime ] [from collideTime to Wispy.set_startTime ] -->
<Collision DEF='OrbCollide'>
<!-- Note that proxy geometry is not rendered -->
<Transform DEF='ProxyGeometryTransformcontainerField='proxytranslation='0 0.6 0'>
<Shape>
<Box size='0.4 1.2 0.4'/>
<Appearance>
<Material transparency='0.8'/>
</Appearance>
</Shape>
</Transform>
<!-- If you want to also see the simplifying proxy geometry, DEF/USE it outside of the proxy containerField subtree. -->
<Transform USE=' ProxyGeometryTransform'/>
<!-- Rest of collidable scene follows. -->
<!-- ROUTE information for OrbSpin node:  [from OrbSpinner.value_changed to set_rotation ] -->
<Transform DEF='OrbSpintranslation='0 1 0'>
<PointLight ambientIntensity='0.2color='0.7 0.5 0location='0.3 0 0radius='10'/>
<Shape>
<Appearance>
<ImageTexture
  url=' "fire.jpg " "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/fire.jpg " ' />

<!-- alternate emissive material as backup, comparable to fire.jpg texturing -->
<Material emissiveColor='0.8 0.4 0.1'/>
</Appearance>
<Sphere radius='0.2'/>
</Shape>
</Transform>
</Collision>
<Shape>
<Appearance DEF='PedestalColor'>
<Material diffuseColor='0.7 0.6 0.5'/>
</Appearance>
<IndexedFaceSet coordIndex='0 1 4 -1 1 2 4 -1 2 3 4 -1 3 0 4 -1'>
<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'/>
</IndexedFaceSet>
</Shape>
<Transform translation='0 0.015 0'>
<Shape>
<Appearance USE=' PedestalColor'/>
<Box size='0.4 0.03 0.4'/>
</Shape>
</Transform>
</Group>
<!-- ROUTE information for WispyAmp node:  [from WispyVolume.value_changed to set_intensity ] -->
<Sound DEF='WispyAmpintensity='0.5'>
<!-- 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" ' />
</Sound>
<!-- Animation clock -->

< ROUTE  fromNode=' OrbCollide' fromField='collideTime' toNode=' Clock' toField='set_startTime'/>
< ROUTE  fromNode=' OrbCollide' fromField='collideTime' toNode=' Wispy' toField='set_startTime'/>
<!-- Orb rotation animation and scalar-driven volume control -->
<!-- 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'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' OrbSpinner' toField='set_fraction'/>
< ROUTE  fromNode=' OrbSpinner' fromField='value_changed' toNode=' OrbSpin' toField='set_rotation'/>
<!-- 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'/>

< ROUTE  fromNode=' Clock' fromField='fraction_changed' toNode=' WispyVolume' toField='set_fraction'/>
< ROUTE  fromNode=' WispyVolume' fromField='value_changed' toNode=' WispyAmp' toField='set_intensity'/>
</Scene>
</X3D>
<!--

to top <!-- Event Graph ROUTE Table shows event connections -->
 
<!-- Index for DEF nodes: Clock, Floor, OrbCollide, OrbSpin, OrbSpinner, PedestalColor, ProxyGeometryTransform, Wispy, WispyAmp, WispyVolume

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2
-->

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.


-->

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