<
head>
</
head>
<!--
-->
<
Scene>
<!-- externprodeclare : chair -->
<
ExternProtoDeclare name='
Chair'
url='
"
Chair.wrl#Chair"
"
http://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Chair.wrl#Chair"
"
Chair.x3d#Chair"
"
http://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Chair.x3d#Chair"
'>
<field name='diffuseColor' type='SFColor' accessType='inputOutput'/>
</
ExternProtoDeclare>
<
ExternProtoDeclare name='
Desk'
url='
"
Desk.wrl#Desk"
"
http://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Desk.wrl#Desk"
"
Desk.x3d#Desk"
"
http://www.web3d.org/x3d/content/examples/Basic/StudentProjects/Desk.x3d#Desk"
'>
<field name='diffuseColor' type='SFColor' accessType='inputOutput'/>
</
ExternProtoDeclare>
<
ExternProtoDeclare name='
WallLamp'
url='
"
WallLamp.wrl#WallLamp"
'>
<field name='lampColor' type='SFColor' accessType='inputOutput'/>
<field name='lightColor' type='SFColor' accessType='inputOutput'/>
<field name='lightIntensity' type='SFFloat' accessType='inputOutput'/>
<field name='lightAttenuation' type='SFVec3f' accessType='inputOutput'/>
<field name='radius' type='SFFloat' accessType='inputOutput'/>
<field name='lightLocation' type='SFVec3f' accessType='inputOutput'/>
</
ExternProtoDeclare>
<
NavigationInfo headlight='
false'
type='
"EXAMINE" "ANY"'
transitionType='
"ANIMATE"'/>
<
Viewpoint description='
entry'
orientation='
1 0 0 -0.2'
position='
16 23 75'/>
<
Transform scale='
0.4 0.4 0.6'>
<
Group>
<!-- floor -->
<
Shape DEF='
wall'>
<
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'/>
<
Appearance DEF='
wallpaper'>
</
Appearance>
</
Shape>
<!-- left wall -->
<
Transform rotation='
0 0 1 1.57'>
</
Transform>
<!-- right wall -->
<
Transform rotation='
0 0 1 1.57'
translation='
80 0 0'>
</
Transform>
<!-- top -->
<
Transform translation='
0 80 0'>
</
Transform>
<!-- front wall -->
<
Transform rotation='
1 0 0 1.57'>
<
Shape>
<
Appearance USE='
wallpaper'/>
<
IndexedFaceSet solid='
false'
coordIndex='
0 1 2 7 -1 2 3 6 7 -1 4 5 6 3 -1'>
<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'/>
</
IndexedFaceSet>
</
Shape>
</
Transform>
<!-- door with its interpalotors and sensors -->
<!--
transform_door ROUTE:
[
from open_door.value_changed to set_rotation
]
-->
<
Transform DEF='
transform_door'
center='
25 0 0'>
<![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;
}
}
}
]]>
</
Transform>
<!-- link to nps site -->
<
Anchor description='
link to NPS web page'
url='
"
http://www.nps.navy.mil/"
'>
<
Transform translation='
40 22.5 -20'>
<
Shape>
<
Appearance>
<Material diffuseColor='0 0 0'/>
</
Appearance>
<
Box size='
30 44.5 1'/>
</
Shape>
</
Transform>
</
Anchor>
</
Group>
<!-- Door sound -->
<
Sound direction='
0 1 1'
location='
40 0 0'
maxBack='
150'
maxFront='
150'>
</
Sound>
</
Transform>
<!-- chair inserted -->
<
Transform scale='
1.5 1.5 1.5'
translation='
10 5.3 35'>
<
ProtoInstance name='
Chair'
containerField='
children'>
<fieldValue name='diffuseColor' value='0 0.3 0.7'/>
</
ProtoInstance>
</
Transform>
<!-- desk inserted -->
<
Transform rotation='
0 1 0 -0.754'
scale='
0.8 0.8 0.7'
translation='
18 8.1 28'>
<
ProtoInstance name='
Desk'
containerField='
children'/>
</
Transform>
<!-- left wall_lamp -->
<
Transform rotation='
0 1 0 1.57'
scale='
2 2 2'
translation='
0.05 23 20'>
<
ProtoInstance name='
WallLamp'
containerField='
children'>
<fieldValue name='lampColor' value='0 0 1'/>
<fieldValue name='lightColor' value='1 1 1'/>
<fieldValue name='lightIntensity' value='0.8'/>
<fieldValue name='lightAttenuation' value='0 0 0'/>
<fieldValue name='radius' value='100'/>
<fieldValue name='lightLocation' value='0 0 5'/>
</
ProtoInstance>
</
Transform>
<!-- right wall_lamp -->
<
Transform rotation='
0 1 0 -1.57'
scale='
2 2 2'
translation='
31.99 23 20'>
<
ProtoInstance name='
WallLamp'
containerField='
children'>
<fieldValue name='lampColor' value='0 0 1'/>
<fieldValue name='lightColor' value='1 1 1'/>
<fieldValue name='lightIntensity' value='0.8'/>
<fieldValue name='lightAttenuation' value='0 0 0'/>
<fieldValue name='radius' value='100'/>
<fieldValue name='lightLocation' value='0 0 -5'/>
</
ProtoInstance>
</
Transform>
<!-- clock inserted on the wall -->
<
Transform translation='
16 22.5 0'>
</
Transform>
<!-- desk lamp inserted in the scene -->
<
Transform scale='
15 15 15'
translation='
16 8.6 25'>
</
Transform>
<!-- routes for the door -->
<
ROUTE fromNode='
touch_door'
fromField='
touchTime'
toNode='
clock'
toField='
startTime'/>
<
ROUTE fromNode='
touch_door'
fromField='
touchTime'
toNode='
open_door_js'
toField='
set_open'/>
<
ROUTE fromNode='
touch_door'
fromField='
touchTime'
toNode='
grinding_door'
toField='
startTime'/>
<
ROUTE fromNode='
open_door_js'
fromField='
keyValue_changed'
toNode='
open_door'
toField='
set_keyValue'/>
<
ROUTE fromNode='
clock'
fromField='
fraction_changed'
toNode='
open_door'
toField='
set_fraction'/>
<
ROUTE fromNode='
open_door'
fromField='
value_changed'
toNode='
transform_door'
toField='
set_rotation'/>
</
Scene>
</