| 1 |
<?xml version="1.0" encoding="UTF-8"?>
|
| 2 |
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
|
| 3 | <X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'> |
| 4 | <head> |
| 5 | <meta name='title' content=' SphericalMinePrototype.x3d '/> |
| 6 | <meta name='description' content='Underwater mine prototype SphericalMine. Note level of detail (LOD) transitions when seen at transition ranges.'/> |
| 7 | <meta name='creator' content='Don Brutzman'/> |
| 8 | <meta name='created' content='26 June 2000'/> |
| 9 | <meta name='modified' content='2 September 2024'/> |
| 10 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Savage/Weapons/UnderwaterMines/SphericalMinePrototype.x3d '/> |
| 11 | <meta name='generator' content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 12 | <meta name='license' content='../../license.html'/> |
| 13 | </head> |
| 14 | <Scene> |
| 15 | <!-- SphericalMine is a simple notional mine --> |
| 16 | <WorldInfo title='SphericalMinePrototype.x3d'/> |
| 17 | <ProtoDeclare name='SphericalMine' appinfo='Spherical floating mine moored to bottom'> |
| 18 | <ProtoInterface> |
| 19 |
<field name='description' type='SFString' value='10 m: Spherical Mine' accessType='initializeOnly'
appinfo='Description for each mine contact.'/> |
| 20 |
<field name='color' type='SFColor' value='.8 .8 .8' accessType='inputOutput'
appinfo='Mine color can be used to indicate status (found/unknown/disabled/) tactic etc.'/> |
| 21 |
<field name='translation' type='SFVec3f' value='0 0 0' accessType='inputOutput'
appinfo='Location of mine center in local world coordinates.'/> |
| 22 |
<field name='scale' type='SFVec3f' value='1 1 1' accessType='inputOutput'
appinfo='Scale factor to change spherical mine size default diameter = 1m.'/> |
| 23 |
<field name='bboxCenter' type='SFVec3f' value='0 0 0' accessType='initializeOnly'
appinfo='Bounding box for collision detection of mine.'/> |
| 24 |
<field name='tetherPoints' type='MFVec3f' value='0 0 0 0 -10 0' accessType='inputOutput'
appinfo='Top and bottom endpoints of line tether that anchors this mine to the bottom.'/> |
| 25 |
<field name='proximityIsActive' type='SFBool' accessType='outputOnly'
appinfo='proximityIsActive can be used to activate information or interaction when the viewer nears the mine.'/> |
| 26 |
<field name='proximitySize' type='SFVec3f' value='10 10 10' accessType='inputOutput'
appinfo='proximitySize provides overall box dimensions for proximity; thus (10 10 10) yields approximate radius 5 to 7 meters.'/> |
| 27 | </ProtoInterface> |
| 28 | <ProtoBody> |
| 29 | <Transform DEF='LOCATOR'> |
| 30 | <IS> |
| 31 | <connect nodeField='translation' protoField='translation'/> |
| 32 | <connect nodeField='scale' protoField='scale'/> |
| 33 | <connect nodeField='bboxCenter' protoField='bboxCenter'/> |
| 34 | </IS> |
| 35 | <LOD range='100 500 5000'> |
| 36 | <!-- High resolution --> |
| 37 | <Group> |
| 38 | <Viewpoint DEF='UW_MINE_VIEWPOINT'> |
| 39 | <IS> |
| 40 | <connect nodeField='description' protoField='description'/> |
| 41 | </IS> |
| 42 | </Viewpoint> |
| 43 | <ProximitySensor DEF='UW_MINE_PROXIMITY'> |
| 44 | <IS> |
| 45 | <connect nodeField='isActive' protoField='proximityIsActive'/> |
| 46 | <connect nodeField='size' protoField='proximitySize'/> |
| 47 | </IS> |
| 48 | </ProximitySensor> |
| 49 |
<!-- Shape
UW_MINE_SPHERE is a DEF node that has 1 USE node: USE_1 -->
<Shape DEF='UW_MINE_SPHERE'> |
| 50 | <Sphere radius='.5'/> |
| 51 |
<!-- Appearance
UW_MINE_APPEARANCE is a DEF node that has 1 USE node: USE_1 -->
<Appearance DEF='UW_MINE_APPEARANCE'> |
| 52 | <Material DEF='UW_MINE_MATERIAL' shininess='.5'> |
| 53 | <IS> |
| 54 | <connect nodeField='diffuseColor' protoField='color'/> |
| 55 | </IS> |
| 56 | </Material> |
| 57 | </Appearance> |
| 58 | </Shape> |
| 59 | <Transform translation='0 .49 0'> |
| 60 | |
| 61 | <Shape> |
| 62 | <Cone bottom='false' bottomRadius='.05' height='.2'/> |
| 63 | <Appearance> |
| 64 | <Material diffuseColor='.8 .8 .8' shininess='.5' specularColor='.2 .2 .2'/> |
| 65 | </Appearance> |
| 66 | </Shape> |
| 67 | </Transform> |
| 68 | </Transform> |
| 69 | <Transform rotation='0 0 1 3.1416' translation='0 -.49 0'> |
| 70 | <Transform USE='SPIKE'/> |
| 71 | </Transform> |
| 72 | <Transform rotation='0 0 1 -1.57079' translation='.49 0 0'> |
| 73 | <Transform USE='SPIKE'/> |
| 74 | </Transform> |
| 75 | <Transform rotation='0 0 1 1.57079' translation='-.49 0 0'> |
| 76 | <Transform USE='SPIKE'/> |
| 77 | </Transform> |
| 78 | <Transform rotation='1 0 0 1.57079' translation='0 0 .49'> |
| 79 | <Transform USE='SPIKE'/> |
| 80 | </Transform> |
| 81 | <Transform rotation='1 0 0 -1.57079' translation='0 0 -.49'> |
| 82 | <Transform USE='SPIKE'/> |
| 83 | </Transform> |
| 84 | <Shape> |
| 85 | <IndexedLineSet coordIndex='0 1 -1'> |
| 86 | <Coordinate DEF='UW_MINE_TETHER'> |
| 87 | <IS> |
| 88 | <connect nodeField='point' protoField='tetherPoints'/> |
| 89 | </IS> |
| 90 | </Coordinate> |
| 91 | </IndexedLineSet> |
| 92 | </Shape> |
| 93 | </Group> |
| 94 | <!-- Medium resolution --> |
| 95 | <Group> |
| 96 | <Viewpoint DEF='UW_MINE_VIEWPOINT_MEDIUM'> |
| 97 | <IS> |
| 98 | <connect nodeField='description' protoField='description'/> |
| 99 | </IS> |
| 100 | </Viewpoint> |
| 101 | <Shape USE='UW_MINE_SPHERE'/> |
| 102 | </Group> |
| 103 | <!-- Low resolution --> |
| 104 | <Shape> |
| 105 | <Box size='12 12 12'/> |
| 106 | <Appearance USE='UW_MINE_APPEARANCE'/> |
| 107 | </Shape> |
| 108 | <!-- No resolution --> |
| 109 | <WorldInfo info='"null geometry"'/> |
| 110 | </LOD> |
| 111 | </Transform> |
| 112 | </ProtoBody> |
| 113 | </ProtoDeclare> |
| 114 | <!-- Show default geometry, in case this Prototype library is viewed directly as a scene --> |
| 115 | <Group DEF='ShowSphericalMines'> |
| 116 |
<!-- ROUTE information for BLUE_SPHERICAL_MINE node:
[from proximityIsActive to NAVIGATION_MODE.inProximity
]
-->
<ProtoInstance name='SphericalMine' DEF='BLUE_SPHERICAL_MINE'> |
| 117 | <fieldValue name='description' value='10 m: blue SphericalMine default viewpoint'/> |
| 118 | <fieldValue name='color' value='0 0 .8'/> |
| 119 | <fieldValue name='translation' value='0 -10 0'/> |
| 120 | <fieldValue name='bboxCenter' value='1 1 1'/> |
| 121 | <fieldValue name='tetherPoints' value='0 0 0 0 -10.0 0'/> |
| 122 | </ProtoInstance> |
| 123 |
<!-- ROUTE information for GREEN_SPHERICAL_MINE node:
[from proximityIsActive to NAVIGATION_MODE.inProximity
]
-->
<ProtoInstance name='SphericalMine' DEF='GREEN_SPHERICAL_MINE'> |
| 124 | <fieldValue name='description' value='10 m: green SphericalMine default viewpoint'/> |
| 125 | <fieldValue name='color' value='0 .8 0'/> |
| 126 | <fieldValue name='translation' value='10 -10 0'/> |
| 127 | <fieldValue name='bboxCenter' value='2 2 2'/> |
| 128 | <fieldValue name='tetherPoints' value='0 0 0 0 -10.0 0'/> |
| 129 | </ProtoInstance> |
| 130 | <Background groundColor='0 .2 .2' skyColor='0 .3 .3'/> |
| 131 | <Viewpoint description='1 m: one closeup SphericalMine' position='10 -10 2'/> |
| 132 | <Viewpoint description='10 m: two pointy SphericalMines' position='5 -10 10'/> |
| 133 | <Viewpoint description='100+ m: two round SphericalMines' position='5 -10 105'/> |
| 134 | <Viewpoint description='500+ m: two boxy SphericalMines' position='5 -10 510'/> |
| 135 | <Viewpoint description='5000+ m: two invisible SphericalMines' position='5 -10 5010'/> |
| 136 | </Group> |
| 137 | <!-- Proximity activation triggers switch in NavigationInfo mode between EXAMINE and WALK - pretty cool! --> |
| 138 |
<!-- ROUTE information for NAVIGATION node:
[from NAVIGATION_MODE.type to set_type
]
-->
<NavigationInfo DEF='NAVIGATION' speed='20' type='"WALK" "EXAMINE" "ANY"'/> |
| 139 |
<!-- ROUTE information for NAVIGATION_MODE node:
[from BLUE_SPHERICAL_MINE.proximityIsActive to inProximity
]
[from GREEN_SPHERICAL_MINE.proximityIsActive to inProximity
]
[from type to NAVIGATION.set_type
]
-->
<Script DEF='NAVIGATION_MODE'> |
| 140 | <field name='inProximity' type='SFBool' accessType='inputOnly'/> |
| 141 | <field name='type' type='MFString' accessType='outputOnly'/> |
<![CDATA[
ecmascript:
function inProximity ( value, eventTime )
{
if ( value == true )
{
type[0] = 'EXAMINE';
type[1] = 'WALK';
type[2] = 'ANY';
}
else
{
type[0] = 'WALK';
type[1] = 'EXAMINE';
type[2] = 'ANY';
}
// Browser.println ('inProximity=' + value + ', type=' + type);
}
]]>
|
|
| 143 | </Script> |
| 144 | < ROUTE fromNode='BLUE_SPHERICAL_MINE' fromField='proximityIsActive' toNode='NAVIGATION_MODE' toField='inProximity'/> |
| 145 | < ROUTE fromNode='GREEN_SPHERICAL_MINE' fromField='proximityIsActive' toNode='NAVIGATION_MODE' toField='inProximity'/> |
| 146 | <!-- TODO match field name in Script exactly --> |
| 147 | < ROUTE fromNode='NAVIGATION_MODE' fromField='type' toNode='NAVIGATION' toField='set_type'/> |
| 148 | </Scene> |
| 149 | </X3D> |
Event Graph ROUTE Table entries with 3 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.
|
BLUE_SPHERICAL_MINE
ProtoInstance proximityIsActive SFBool |
NAVIGATION_MODE
Script inProximity SFBool |
then
|
NAVIGATION_MODE
Script type MFString |
NAVIGATION
NavigationInfo set_type MFString |
|
GREEN_SPHERICAL_MINE
ProtoInstance proximityIsActive SFBool |
NAVIGATION_MODE
Script inProximity SFBool |
then
|
NAVIGATION_MODE
Script type MFString |
NAVIGATION
NavigationInfo set_type MFString |
<!--
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)
<ProtoInstance name='ProtoName'>
<field
name='fieldName'/> </ProtoInstance>
-->
<!--
For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints.
-->