<
head>
</
head>
<!--
Index for ExternProtoDeclare definition:
WhereAmI
Index for DEF nodes:
Angle,
b1,
CandyGreen,
CandyRed,
CandyTurquoise,
Control,
CylinderRod,
EyeCandy,
Filter,
PISTON,
PISTONClock,
PISTONPath,
pumpHouse,
ROCKER1Path,
ROCKER1Rotation,
ROCKER2Path,
ROCKER2Rotation,
ROCKERARM1,
ROCKERARM2,
RunPump,
Timer
Index for Viewpoint image:
Viewpoint_1
-->
<
Scene>
<
WorldInfo info='
DTG of last update: 081200Jun98 Added: Updated: cycleInterval to 5.5 Modeled by: Todd Gagnon and Mark A. Boyd'
title='
pumpHouse1.4.wrl'/>
<
ExternProtoDeclare name='
WhereAmI'
url='
"
../Chapter14-Prototypes/WhereAmI.x3d#WhereAmI"
"
http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14-Prototypes/WhereAmI.x3d#WhereAmI"
"
../Chapter14-Prototypes/WhereAmI.wrl#WhereAmI"
"
http://X3dGraphics.com/examples/X3dForWebAuthors/Chapter14-Prototypes/WhereAmI.wrl#WhereAmI"
'/>
<
ProtoInstance name='
WhereAmI'
containerField='
children'/>
<
Background skyColor='
1 1 1'/>
<
Viewpoint description='
Book View'
orientation='
-0.969 0.239 0.056 0.13'
position='
1.66 1.34 5.95'/>
<
Group>
<
Transform scale='
0.91 0.6 0.3'
translation='
0.8 -0.65 0.5'>
<
Shape>
<
Appearance>
<Material diffuseColor='0.749 0.694 0.651'/>
</
Appearance>
<
Cylinder bottom='
false'
top='
false'/>
</
Shape>
</
Transform>
<
Group>
<
Shape>
<
Appearance DEF='
pumpHouse'>
<Material diffuseColor='0.82 0.78 0.74'/>
</
Appearance>
<
IndexedFaceSet coordIndex='
0 1 5 4 -1 5 1 2 6 -1 6 2 3 7 -1 3 0 4 7 -1 1 12 13 2 -1 2 13 14 -1 12 15 16 13 -1 15 0 3 16 -1 16 3 17 -1 9 5 6 10 -1 8 9 10 11 -1 4 8 11 7 -1 4 5 9 8 -1 11 10 6 7 -1 3 2 14 17 -1 13 16 17 14 -1'>
<Coordinate point='0.0 0.0 0.0 2.0 0.0 0.0 2.0 1.75 0.0 0.0 1.75 0.0 0.625 0.75 0.0 1.0 0.75 0.0 1.0 1.6 0.0 0.625 1.6 0.0 0.625 0.75 -0.65 1.0 0.75 -0.65 1.0 1.6 -0.65 0.625 1.6 -0.65 2.0 0.0 -2.7 2.0 1.75 -2.7 2.0 2.5 -1.0 0.0 0.0 -2.7 0.0 1.75 -2.7 0.0 2.5 -1.0'/>
</
IndexedFaceSet>
</
Shape>
<!--
RunPump ROUTE:
[
from isActive to Filter.set_boolean
]
-->
<
TouchSensor DEF='
RunPump'
description='
touch to activate'/>
</
Group>
</
Group>
<
Group>
<
Transform scale='
0.5 0.5 0.5'
translation='
1.0 1.1 -1.5'>
<![CDATA[
ecmascript:
// The function'angle' computes the position
// and orientation of each of the cones. The
// values 2.094 and 4.189 are 1/3 and 2/3 of 2*pi
// radians
function angle (value) {
posRed = new SFVec3f (Math.cos (value), 1.5 * Math.sin(value), .5);
posGrn = new SFVec3f (Math.cos (value+2.094), 1.5 * Math.sin(value+2.094), 0);
posTuq = new SFVec3f (Math.cos (value+4.189), 1.5 * Math.sin(value+4.189), -.5);
orRed = new SFRotation (0, 0, 1, -2*value);
orGrn = new SFRotation (0, 0, 1, -2*(value+2.094));
orTuq = new SFRotation (0, 0, 1, -2*(value+4.189));
}
]]>
</
Group>
<
ROUTE fromNode='
RunPump'
fromField='
isActive'
toNode='
Filter'
toField='
set_boolean'/>
<
ROUTE fromNode='
Filter'
fromField='
inputTrue'
toNode='
Timer'
toField='
enabled'/>
<
ROUTE fromNode='
Timer'
fromField='
fraction_changed'
toNode='
Angle'
toField='
set_fraction'/>
<
ROUTE fromNode='
Angle'
fromField='
value_changed'
toNode='
Control'
toField='
angle'/>
<
ROUTE fromNode='
Control'
fromField='
posRed'
toNode='
CandyRed'
toField='
translation'/>
<
ROUTE fromNode='
Control'
fromField='
posGrn'
toNode='
CandyGreen'
toField='
translation'/>
<
ROUTE fromNode='
Control'
fromField='
posTuq'
toNode='
CandyTurquoise'
toField='
translation'/>
<
ROUTE fromNode='
Control'
fromField='
orRed'
toNode='
CandyRed'
toField='
rotation'/>
<
ROUTE fromNode='
Control'
fromField='
orGrn'
toNode='
CandyGreen'
toField='
rotation'/>
<
ROUTE fromNode='
Control'
fromField='
orTuq'
toNode='
CandyTurquoise'
toField='
rotation'/>
<
ROUTE fromNode='
Filter'
fromField='
inputFalse'
toNode='
PISTONClock'
toField='
enabled'/>
<
ROUTE fromNode='
PISTONClock'
fromField='
fraction_changed'
toNode='
PISTONPath'
toField='
set_fraction'/>
<
ROUTE fromNode='
PISTONPath'
fromField='
value_changed'
toNode='
PISTON'
toField='
set_translation'/>
<
ROUTE fromNode='
PISTONClock'
fromField='
fraction_changed'
toNode='
ROCKER1Path'
toField='
set_fraction'/>
<
ROUTE fromNode='
ROCKER1Path'
fromField='
value_changed'
toNode='
ROCKERARM1'
toField='
set_translation'/>
<
ROUTE fromNode='
PISTONClock'
fromField='
fraction_changed'
toNode='
ROCKER1Rotation'
toField='
set_fraction'/>
<
ROUTE fromNode='
ROCKER1Rotation'
fromField='
value_changed'
toNode='
ROCKERARM1'
toField='
set_rotation'/>
<
ROUTE fromNode='
PISTONClock'
fromField='
fraction_changed'
toNode='
ROCKER2Path'
toField='
set_fraction'/>
<
ROUTE fromNode='
ROCKER2Path'
fromField='
value_changed'
toNode='
ROCKERARM2'
toField='
set_translation'/>
<
ROUTE fromNode='
PISTONClock'
fromField='
fraction_changed'
toNode='
ROCKER2Rotation'
toField='
set_fraction'/>
<
ROUTE fromNode='
ROCKER2Rotation'
fromField='
value_changed'
toNode='
ROCKERARM2'
toField='
set_rotation'/>
</
Scene>
</