| 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='title' content=' 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='creator' content='Figure 27.3, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland'/> |
| 9 | <meta name='reference' content=' http://www.wiley.com/legacy/compbooks/vrml2sbk/ch27/27fig03.htm '/> |
| 10 | <meta name='translator' content='Don Brutzman'/> |
| 11 | <meta name='created' content='26 October 2000'/> |
| 12 | <meta name='modified' content='7 April 2024'/> |
| 13 | <meta name='description' content='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='identifier' content=' https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/Figure27_3CollisionDetectionSpinningOrb.x3d '/> |
| 15 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 16 | <meta name='license' content='../../license.html'/> |
| 17 | </head> |
| 18 | <Scene> |
| 19 | <WorldInfo title='Figure27_3CollisionDetectionSpinningOrb.x3d'/> |
| 20 | <Viewpoint description='Zoom in on the orb to trigger the Collision node' position='0 2 10'/> |
| 21 | <Viewpoint description='Close-up viewpoint by the orb that triggers the Collision node' position='0 0.8 2.5'/> |
| 22 | <!-- Note NavigationInfo avatarSize affects collision range --> |
| 23 | <NavigationInfo avatarSize='2 1 0.5' headlight='false' speed='2' type='"WALK" "EXAMINE" "ANY"'/> |
| 24 | <Group> |
| 25 | <Transform translation='0 0 2.5'> |
| 26 |
<!-- Inline
Floor is a DEF node that has 1 USE node: USE_1 --> <Inline DEF='Floor' url=' "../Chapter25LevelOfDetail/Figure25_06DungeonRoomFloor.x3d" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25LevelOfDetail/Figure25_06DungeonRoomFloor.x3d" "../Chapter25LevelOfDetail/Figure25_06DungeonRoomFloor.wrl" "https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25LevelOfDetail/Figure25_06DungeonRoomFloor.wrl" '/> |
| 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='ProxyGeometryTransform' containerField='proxy' translation='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='OrbSpin' translation='0 1 0'> |
| 45 | <PointLight ambientIntensity='0.2' color='0.7 0.5 0' location='0.3 0 0' radius='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='WispyAmp' intensity='0.5'> |
| 72 |
<!-- ROUTE information for Wispy node:
[from OrbCollide.collideTime to set_startTime
]
-->
<AudioClip DEF='Wispy' description='drone' loop='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='Clock' cycleInterval='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='OrbSpinner' key='0 0.5 1' keyValue='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='WispyVolume' key='0 0.1 0.9 1' keyValue='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 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.
<!--
Color-coding 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)
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->