<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://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 =' http://www.web3d.org/specifications/x3d-3.0.xsd '>
<head>
<meta name='titlecontent='Figure27.3CollisionDetectionSpinningOrb.x3d'/>
<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='11 January 2014'/>
<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=' http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/Figure27.3CollisionDetectionSpinningOrb.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<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>
<!-- OrbCollide ROUTEs:  [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. -->
<!-- OrbSpin ROUTE:  [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" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/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>
<!-- WispyAmp ROUTE:  [from WispyVolume.value_changed to set_intensity ] -->
<Sound DEF='WispyAmpintensity='0.5'> </Sound>
<!-- Animation clock -->
<!-- Clock ROUTEs:  [from OrbCollide.collideTime to set_startTime ] [from fraction_changed to OrbSpinner.set_fraction ] [from fraction_changed to WispyVolume.set_fraction ] -->
<TimeSensor DEF='ClockcycleInterval='8'/>
<ROUTE fromNode='OrbCollidefromField='collideTimetoNode='ClocktoField='set_startTime'/>
<ROUTE fromNode='OrbCollidefromField='collideTimetoNode='WispytoField='set_startTime'/>
<!-- Orb rotation animation and scalar-driven volume control -->
<!-- OrbSpinner ROUTEs:  [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='ClockfromField='fraction_changedtoNode='OrbSpinnertoField='set_fraction'/>
<ROUTE fromNode='OrbSpinnerfromField='value_changedtoNode='OrbSpintoField='set_rotation'/>
<!-- WispyVolume ROUTEs:  [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='ClockfromField='fraction_changedtoNode='WispyVolumetoField='set_fraction'/>
<ROUTE fromNode='WispyVolumefromField='value_changedtoNode='WispyAmptoField='set_intensity'/>
</Scene>
</X3D>
<!--

Index for DEF nodes : Clock, Floor, OrbCollide, OrbSpin, OrbSpinner, PedestalColor, ProxyGeometryTransform, Wispy, WispyAmp, WispyVolume

Index for Viewpoint images : Viewpoint_1, Viewpoint_2
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/> -->

<!-- Additional help information about X3D scenes: X3D Resources, X3D Scene Authoring Hints and X3D Tooltips -->