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=' Castle Game Engine view3dscene Issue: tovrmlx3d.exe ROUTE validation confused by similar DEF names OrbSpin, OrbSpinner '/> |
7 | <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'/> |
8 | <meta name='reference' content='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch27/27fig03.htm'/> |
9 | <meta name='translator' content='Don Brutzman'/> |
10 | <meta name='created' content='26 October 2000'/> |
11 | <meta name='modified' content='7 April 2024'/> |
12 | <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.'/> |
13 | <meta name='identifier' content='https://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27SensingVisibilityProximityCollision/Figure27_3CollisionDetectionSpinningOrb.x3d'/> |
14 | <meta name='generator' content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/> |
15 | <meta name='license' content='../../license.html'/> |
16 | </head> |
17 | <Scene> |
18 | <WorldInfo title='Figure27_3CollisionDetectionSpinningOrb.x3d'/> |
19 | <Viewpoint description='Zoom in on the orb to trigger the Collision node' position='0 2 10'/> |
20 | <Viewpoint description='Close-up viewpoint by the orb that triggers the Collision node' position='0 0.8 2.5'/> |
21 | <!-- Note NavigationInfo avatarSize affects collision range --> |
22 | <NavigationInfo avatarSize='2 1 0.5' headlight='false' speed='2' type='"WALK" "EXAMINE" "ANY"'/> |
23 | <Group> |
24 | <Transform translation='0 0 2.5'> |
25 |
<!-- 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" '/> |
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='ProxyGeometryTransform' containerField='proxy' translation='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='OrbSpin' translation='0 1 0'> |
44 | <PointLight ambientIntensity='0.2' color='0.7 0.5 0' location='0.3 0 0' radius='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='WispyAmp' intensity='0.5'> |
71 |
<!-- 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" '/> |
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='Clock' cycleInterval='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='OrbSpinner' key='0 0.5 1' keyValue='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='WispyVolume' key='0 0.1 0.9 1' keyValue='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 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 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. -->