| 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=' Room.x3d '/> |
| 6 | <meta name='description' content='A simple room containing protoype instances for chair, desk lamp, wall clock, etc.'/> |
| 7 | <meta name='creator' content='Frederic Roussille'/> |
| 8 | <meta name='created' content='1 April 2001'/> |
| 9 | <meta name='modified' content='20 October 2019'/> |
| 10 | <meta name='identifier' content=' https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Room.x3d '/> |
| 11 | <meta name='generator' content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit'/> |
| 12 | <meta name='license' content='../license.html'/> |
| 13 | </head> |
| 14 | <Scene> |
| 15 | <!-- externprodeclare : chair --> |
| 16 | <WorldInfo title='Room.x3d'/> |
| 17 | <ExternProtoDeclare name='Chair' url=' "Chair.x3d#Chair" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Chair.x3d#Chair" "Chair.wrl#Chair" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Chair.wrl#Chair" '> |
| 18 | <field name='diffuseColor' type='SFColor' accessType='inputOutput'/> |
| 19 | </ExternProtoDeclare> |
| 20 | <ExternProtoDeclare name='Desk' url=' "Desk.x3d#Desk" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Desk.x3d#Desk" "Desk.wrl#Desk" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Desk.wrl#Desk" '> |
| 21 | <field name='diffuseColor' type='SFColor' accessType='inputOutput'/> |
| 22 | </ExternProtoDeclare> |
| 23 | <ExternProtoDeclare name='WallLamp' url=' "WallLamp.x3d#WallLamp" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/WallLamp.x3d#WallLamp" "WallLamp.wrl#WallLamp" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/WallLamp.wrl#WallLamp" '> |
| 24 | <field name='lampColor' type='SFColor' accessType='inputOutput'/> |
| 25 | <field name='lightColor' type='SFColor' accessType='inputOutput'/> |
| 26 | <field name='lightIntensity' type='SFFloat' accessType='inputOutput'/> |
| 27 | <field name='lightAttenuation' type='SFVec3f' accessType='inputOutput'/> |
| 28 | <field name='radius' type='SFFloat' accessType='inputOutput'/> |
| 29 | <field name='lightLocation' type='SFVec3f' accessType='inputOutput'/> |
| 30 | </ExternProtoDeclare> |
| 31 | <NavigationInfo headlight='false'/> |
| 32 | <Viewpoint description='entry' orientation='1 0 0 -0.2' position='16 23 75'/> |
| 33 | <Transform scale='0.4 0.4 0.6'> |
| 34 | <Group> |
| 35 | <!-- floor --> |
| 36 | |
| 37 | <ElevationGrid solid='false' xDimension='9' xSpacing='10' zDimension='9' zSpacing='10' height='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'/> |
| 38 | |
| 39 |
<ImageTexture
url=' "WallPaper.jpg
" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/WallPaper.jpg
" '/>
|
| 40 | <TextureTransform scale='2 2'/> |
| 41 | <Material/> |
| 42 | </Appearance> |
| 43 | </Shape> |
| 44 | <!-- left wall --> |
| 45 | <Transform rotation='0 0 1 1.57'> |
| 46 | <Shape USE='wall'/> |
| 47 | </Transform> |
| 48 | <!-- right wall --> |
| 49 | <Transform rotation='0 0 1 1.57' translation='80 0 0'> |
| 50 | <Shape USE='wall'/> |
| 51 | </Transform> |
| 52 | <!-- top --> |
| 53 | <Transform translation='0 80 0'> |
| 54 | <Shape USE='wall'/> |
| 55 | </Transform> |
| 56 | <!-- front wall --> |
| 57 | <Transform rotation='1 0 0 1.57'> |
| 58 | <Shape> |
| 59 | <Appearance USE='wallpaper'/> |
| 60 | <IndexedFaceSet solid='false' coordIndex='0 1 2 7 -1 2 3 6 7 -1 4 5 6 3 -1'> |
| 61 | <Coordinate point='0 0 0 25 0 0 25 0 -45 55 0 -45 55 0 0 80 0 0 80 0 -80 0 0 -80'/> |
| 62 | </IndexedFaceSet> |
| 63 | </Shape> |
| 64 | </Transform> |
| 65 | <!-- door with its interpalotors and sensors --> |
| 66 |
<!-- ROUTE information for transform_door node:
[from open_door.value_changed to set_rotation
]
-->
<Transform DEF='transform_door' center='25 0 0'> |
| 67 | <Transform translation='40 22.5 0'> |
| 68 | <Shape> |
| 69 | <Appearance> |
| 70 |
<ImageTexture
url=' "Door.jpg
" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Door.jpg
" '/>
|
| 71 | </Appearance> |
| 72 | <Box size='30 44.5 2'/> |
| 73 | </Shape> |
| 74 |
<!-- ROUTE information for touch_door node:
[from touchTime to clock.startTime
]
[from touchTime to open_door_js.set_open
]
[from touchTime to grinding_door.startTime
]
-->
<TouchSensor DEF='touch_door' description='touch door to open/close'/> |
| 75 | </Transform> |
| 76 |
<!-- ROUTE information for open_door_js node:
[from touch_door.touchTime to set_open
]
[from keyValue_changed to open_door.set_keyValue
]
-->
<Script DEF='open_door_js'> |
| 77 | <field name='set_open' type='SFTime' accessType='inputOnly'/> |
| 78 | <field name='keyValue_changed' type='MFRotation' accessType='outputOnly'/> |
| 79 | <field name='open' type='SFBool' value='false' accessType='initializeOnly'/> |
<![CDATA[
ecmascript:
function set_open() {
keyValue_changed[0][0] = 0;
keyValue_changed[0][1] = 1;
keyValue_changed[0][2] = 0;
keyValue_changed[1][0] = 0;
keyValue_changed[1][1] = 1;
keyValue_changed[1][2] = 0;
keyValue_changed[1][3] = -0.754;
keyValue_changed[2][0] = 0;
keyValue_changed[2][1] = 1;
keyValue_changed[2][2] = 0;
if(open == false) {
keyValue_changed[0][3] = 0;
keyValue_changed[2][3] = -1.57;
open = true;
} else {
if(open == true) {
keyValue_changed[0][3] = -1.57;
keyValue_changed[2][3] = 0;
open = false;
}
}
}
]]>
|
|
| 81 | </Script> |
| 82 |
<!-- ROUTE information for clock node:
[from touch_door.touchTime to startTime
]
[from fraction_changed to open_door.set_fraction
]
-->
<TimeSensor DEF='clock' cycleInterval='4.5'/> |
| 83 |
<!-- ROUTE information for open_door node:
[from open_door_js.keyValue_changed to set_keyValue
]
[from clock.fraction_changed to set_fraction
]
[from value_changed to transform_door.set_rotation
]
-->
<OrientationInterpolator DEF='open_door' key='0 0.5 1' keyValue='0 1 0 0 0 1 0 0 0 1 0 0'/> |
| 84 | </Transform> |
| 85 | <!-- link to nps site --> |
| 86 | <Anchor description='link to NPS web page' url=' "https://www.nps.edu" '> |
| 87 | <Transform translation='40 22.5 -20'> |
| 88 | <Shape> |
| 89 | <Appearance> |
| 90 | <Material diffuseColor='0 0 0'/> |
| 91 | </Appearance> |
| 92 | <Box size='30 44.5 1'/> |
| 93 | </Shape> |
| 94 | </Transform> |
| 95 | </Anchor> |
| 96 | </Group> |
| 97 | <!-- Door sound --> |
| 98 | <Sound direction='0 1 1' location='40 0 0' maxBack='150' maxFront='150'> |
| 99 |
<!-- ROUTE information for grinding_door node:
[from touch_door.touchTime to startTime
]
-->
<AudioClip DEF='grinding_door' description='GrindingDoor' url=' "GrindingDoor.wav" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/GrindingDoor.wav" '/> |
| 100 | </Sound> |
| 101 | </Transform> |
| 102 | <!-- chair inserted --> |
| 103 | <Transform scale='1.5 1.5 1.5' translation='10 5.3 35'> |
| 104 | <ProtoInstance name='Chair'> |
| 105 | <fieldValue name='diffuseColor' value='0 0.3 0.7'/> |
| 106 | </ProtoInstance> |
| 107 | </Transform> |
| 108 | <!-- desk inserted --> |
| 109 | <Transform rotation='0 1 0 -0.754' scale='0.8 0.8 0.7' translation='18 8.1 28'> |
| 110 | <ProtoInstance name='Desk'/> |
| 111 | </Transform> |
| 112 | <!-- left wall_lamp --> |
| 113 | <Transform rotation='0 1 0 1.57' scale='2 2 2' translation='0.05 23 20'> |
| 114 | <ProtoInstance name='WallLamp'> |
| 115 | <fieldValue name='lampColor' value='0 0 1'/> |
| 116 | <fieldValue name='lightColor' value='1 1 1'/> |
| 117 | <fieldValue name='lightIntensity' value='0.8'/> |
| 118 | <fieldValue name='lightAttenuation' value='0 0 0'/> |
| 119 | <fieldValue name='radius' value='100'/> |
| 120 | <fieldValue name='lightLocation' value='0 0 5'/> |
| 121 | </ProtoInstance> |
| 122 | </Transform> |
| 123 | <!-- right wall_lamp --> |
| 124 | <Transform rotation='0 1 0 -1.57' scale='2 2 2' translation='31.99 23 20'> |
| 125 | <ProtoInstance name='WallLamp'> |
| 126 | <fieldValue name='lampColor' value='0 0 1'/> |
| 127 | <fieldValue name='lightColor' value='1 1 1'/> |
| 128 | <fieldValue name='lightIntensity' value='0.8'/> |
| 129 | <fieldValue name='lightAttenuation' value='0 0 0'/> |
| 130 | <fieldValue name='radius' value='100'/> |
| 131 | <fieldValue name='lightLocation' value='0 0 -5'/> |
| 132 | </ProtoInstance> |
| 133 | </Transform> |
| 134 | <!-- clock inserted on the wall --> |
| 135 | <Transform translation='16 22.5 0'> |
| 136 | <Inline url=' "WallClock.x3d" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/WallClock.x3d" "WallClock.wrl" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/WallClock.wrl" '/> |
| 137 | </Transform> |
| 138 | <!-- desk lamp inserted in the scene --> |
| 139 | <Transform scale='15 15 15' translation='16 8.6 25'> |
| 140 | <Inline url=' "DeskLamp.x3d" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/DeskLamp.x3d" "DeskLamp.wrl" "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/DeskLamp.wrl" '/> |
| 141 | </Transform> |
| 142 | <!-- routes for the door --> |
| 143 | < ROUTE fromNode='touch_door' fromField='touchTime' toNode='clock' toField='startTime'/> |
| 144 | < ROUTE fromNode='touch_door' fromField='touchTime' toNode='open_door_js' toField='set_open'/> |
| 145 | < ROUTE fromNode='touch_door' fromField='touchTime' toNode='grinding_door' toField='startTime'/> |
| 146 | < ROUTE fromNode='open_door_js' fromField='keyValue_changed' toNode='open_door' toField='set_keyValue'/> |
| 147 | < ROUTE fromNode='clock' fromField='fraction_changed' toNode='open_door' toField='set_fraction'/> |
| 148 | < ROUTE fromNode='open_door' fromField='value_changed' toNode='transform_door' toField='set_rotation'/> |
| 149 | </Scene> |
| 150 | </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.
|
touch_door
TouchSensor touchTime SFTime |
clock
TimeSensor startTime SFTime |
then
|
clock
TimeSensor fraction_changed SFFloat |
open_door
OrientationInterpolator set_fraction SFFloat |
then
|
open_door
OrientationInterpolator value_changed SFRotation |
transform_door
Transform set_rotation SFRotation |
|||
|
touch_door
TouchSensor touchTime SFTime |
open_door_js
Script set_open SFTime |
then
|
open_door_js
Script keyValue_changed MFRotation |
open_door
OrientationInterpolator set_keyValue MFRotation |
then
|
open_door
OrientationInterpolator value_changed SFRotation |
transform_door
Transform set_rotation SFRotation |
|||
|
touch_door
TouchSensor touchTime SFTime |
grinding_door
AudioClip startTime SFTime |
| line 104
ProtoInstance Chair |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
| line 110
ProtoInstance Desk |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
| line 114
ProtoInstance WallLamp |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
| line 125
ProtoInstance WallLamp |
No direct ROUTE connection found for events to/from this node. This ProtoInstance contains SFNode/MFNode fieldValue declarations with direct access to other nodes, and thus has potential to produce run-time animation. |
| line 86
Anchor |
description='link to NPS web page' User-interaction hint for this node. |
<!--
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.
-->