home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Late Night VRML 2.0 with Java CD-ROM
/
code.zip
/
Ch11
/
train
/
train.wrl
< prev
next >
Wrap
Text File
|
1997-03-31
|
15KB
|
510 lines
#VRML V2.0 utf8
WorldInfo {
info [ "Created in CosmoWorlds",
"Packaged by CosmoPackage" ]
}
DEF navInfo NavigationInfo {
avatarSize [ 5, 10, 5 ]
headlight FALSE
type "FLY"
}
Background {
skyColor 0.38 0.63 0.75
}
DEF entryView Viewpoint {
position -319.9 56.03 2026
orientation -0.9742 0.2183 -0.05749 0.1296
fieldOfView 0.7854
description "entry"
}
DEF trainGroup Transform {
children [
DEF echoTimer TimeSensor {
cycleInterval 0.5
loop FALSE
startTime 0
}
DEF fadeTimer TimeSensor {
cycleInterval 0.5
loop FALSE
startTime 0
}
Group {
children [
DEF trainLoop Group {
children DEF trainTimer TimeSensor {
cycleInterval 24
loop TRUE
startTime 0
stopTime 1
}
}
DEF trainGroupTranslationInterp PositionInterpolator {
key [ 0, 0.008333, 0.01667, 0.025,
0.03333, 0.04167, 0.05, 0.05833,
0.06667, 0.07639, 0.08611, 0.09583,
0.1056, 0.1153, 0.125, 0.1333,
0.1417, 0.15, 0.1583, 0.1667,
0.175, 0.1833, 0.1917, 0.2014,
0.2111, 0.2208, 0.2306, 0.2403,
0.25, 0.2583, 0.2667, 0.275,
0.2833, 0.2917, 0.3, 0.3083,
0.3167, 0.3264, 0.3361, 0.3458,
0.3556, 0.3653, 0.375, 0.3833,
0.3917, 0.4, 0.4083, 0.4167,
0.425, 0.4333, 0.4417, 0.4514,
0.4611, 0.4708, 0.4806, 0.4903,
0.5, 0.5083, 0.5167, 0.525,
0.5333, 0.5417, 0.55, 0.5583,
0.5667, 0.5764, 0.5861, 0.5958,
0.6056, 0.6153, 0.625, 0.6333,
0.6417, 0.65, 0.6583, 0.6667,
0.675, 0.6833, 0.6917, 0.7014,
0.7111, 0.7208, 0.7306, 0.7403,
0.75, 0.7583, 0.7667, 0.775,
0.7833, 0.7917, 0.8, 0.8083,
0.8167, 0.825, 0.8333, 0.8417,
0.85, 0.8583, 0.8667, 0.875,
0.8833, 0.8917, 0.9, 0.9083,
0.9167, 0.925, 0.9333, 0.9417,
0.9514, 0.9611, 0.9708, 0.9806,
0.9903, 1 ]
keyValue [ 37.8 9.155e-05 52.79,
53.99 -0.1981 60.23,
69.6 -0.3814 67.85,
84.96 -0.5588 75.54,
100.4 -0.7391 83.19,
116.4 -0.9313 90.7,
133.2 -1.144 97.95,
151.2 -1.387 104.8,
170.7 -1.668 111.3,
196.4 -2.106 118.7,
225 -2.66 126.1,
255.3 -3.257 133,
286 -3.821 138.9,
316 -4.278 143,
343.8 -4.554 145,
366.2 -4.763 144.8,
388.2 -5.058 143.3,
409.8 -5.352 140.7,
430.9 -5.556 137.2,
451.5 -5.583 133.1,
471.5 -5.345 128.6,
490.8 -4.756 123.9,
509.4 -3.727 119.2,
530.3 -1.768 113.7,
550.1 0.9606 107.8,
568.9 4.211 101.3,
586.5 7.737 93.92,
602.9 11.29 85.39,
618 14.62 75.45,
629.8 17.28 66.11,
640.7 19.88 56.37,
650.9 22.47 46.09,
660.4 25.09 35.11,
669.4 27.78 23.29,
678 30.58 10.45,
686.4 33.52 -3.533,
694.8 36.65 -18.83,
704.8 40.75 -39.35,
714.9 45.35 -62.83,
724.5 50.16 -88.18,
732.8 54.91 -114.3,
739.3 59.32 -140.2,
743.2 63.1 -164.6,
744.6 65.9 -184.6,
744.8 68.48 -204.4,
743.9 70.85 -224,
742 73.04 -243.5,
739.1 75.06 -262.8,
735.3 76.92 -281.9,
730.7 78.62 -300.8,
725.3 80.2 -319.5,
717.8 81.72 -341.3,
708.5 82.86 -363.3,
697.8 83.72 -384.9,
685.6 84.41 -405.8,
672.1 85.05 -425.4,
657.4 85.74 -443.4,
644.1 86.37 -457.8,
630.1 86.96 -471.8,
615.4 87.5 -485.1,
599.9 88.03 -497.8,
583.7 88.53 -509.6,
566.7 89.01 -520.3,
548.9 89.5 -529.9,
530.2 89.98 -538.2,
506.4 90.64 -545.8,
480.1 91.39 -551.1,
452.5 92.12 -554.5,
424.4 92.72 -556.4,
396.8 93.08 -557.2,
370.8 93.09 -557.4,
349.7 92.82 -557.2,
328.8 92.39 -556.4,
308.2 91.81 -555.1,
288 91.1 -553.1,
268.1 90.28 -550.5,
248.5 89.36 -547.2,
229.3 88.35 -543.1,
210.6 87.28 -538.3,
188.7 85.96 -532,
166.8 84.53 -525.1,
145.5 82.93 -516.9,
125.5 81.11 -506.8,
107.6 79.01 -494.1,
92.33 76.59 -478.3,
80.68 74.32 -462.8,
69.22 71.96 -446.6,
57.99 69.54 -429.6,
47.02 67.05 -412.1,
36.33 64.5 -394.1,
25.97 61.92 -375.7,
15.96 59.29 -357,
6.335 56.65 -338.1,
-2.875 53.99 -319,
-11.64 51.32 -299.8,
-19.92 48.65 -280.7,
-27.69 46 -261.7,
-34.92 43.37 -242.9,
-41.57 40.77 -224.4,
-47.61 38.21 -206.2,
-52.28 35.69 -188.4,
-54.93 33.2 -170.8,
-55.77 30.73 -153.2,
-54.98 28.26 -135.8,
-52.77 25.79 -118.4,
-49.32 23.31 -101.1,
-44.83 20.81 -83.8,
-39.5 18.28 -66.53,
-30.95 15.29 -46.47,
-19.28 12.25 -26.53,
-5.529 9.196 -6.676,
9.26 6.127 13.13,
24.05 3.057 32.94,
37.8 9.155e-05 52.79 ]
}
DEF trainGroupRotationInterp OrientationInterpolator {
key [ 0, 0.008333, 0.01667, 0.025,
0.03333, 0.04167, 0.05, 0.05833,
0.06667, 0.07639, 0.08611, 0.09583,
0.1056, 0.1153, 0.125, 0.1333,
0.1417, 0.15, 0.1583, 0.1667,
0.175, 0.1833, 0.1917, 0.2014,
0.2111, 0.2208, 0.2306, 0.2403,
0.25, 0.2583, 0.2667, 0.275,
0.2833, 0.2917, 0.3, 0.3083,
0.3167, 0.3264, 0.3361, 0.3458,
0.3556, 0.3653, 0.375, 0.3833,
0.3917, 0.4, 0.4083, 0.4167,
0.425, 0.4333, 0.4417, 0.4514,
0.4611, 0.4708, 0.4806, 0.4903,
0.5, 0.5083, 0.5167, 0.525,
0.5333, 0.5417, 0.55, 0.5583,
0.5667, 0.5764, 0.5861, 0.5958,
0.6056, 0.6153, 0.625, 0.6333,
0.6417, 0.65, 0.6583, 0.6667,
0.675, 0.6833, 0.6917, 0.7014,
0.7111, 0.7208, 0.7306, 0.7403,
0.75, 0.7583, 0.7667, 0.775,
0.7833, 0.7917, 0.8, 0.8083,
0.8167, 0.825, 0.8333, 0.8417,
0.85, 0.8583, 0.8667, 0.875,
0.8833, 0.8917, 0.9, 0.9083,
0.9167, 0.925, 0.9333, 0.9417,
0.9514, 0.9611, 0.9708, 0.9806,
0.9903, 1 ]
keyValue [ -0.1777 0.9832 0.04141 0.4654,
-0.1406 0.9875 0.07089 0.4923,
-0.09496 0.9896 0.1077 0.5306,
-0.04809 0.9883 0.1449 0.5783,
-0.004746 0.984 0.1783 0.6325,
0.03258 0.9781 0.2055 0.6898,
0.06299 0.9721 0.226 0.7465,
0.08639 0.9671 0.2394 0.7985,
0.103 0.9638 0.2459 0.8421,
0.1178 0.9624 0.2446 0.8873,
0.1282 0.9632 0.2361 0.9237,
0.1355 0.9652 0.2238 0.9547,
0.1408 0.9673 0.2109 0.9838,
0.1446 0.969 0.2002 1.014,
0.1477 0.9697 0.1946 1.05,
0.1508 0.9694 0.1938 1.078,
0.1549 0.9686 0.1945 1.106,
0.159 0.9676 0.1962 1.134,
0.162 0.9666 0.1986 1.163,
0.1631 0.9659 0.2011 1.194,
0.1613 0.9657 0.2035 1.227,
0.1559 0.9662 0.2053 1.263,
0.1464 0.9675 0.2061 1.304,
0.1262 0.9702 0.2067 1.368,
0.1 0.9732 0.2072 1.441,
0.07149 0.9757 0.207 1.52,
0.04347 0.9776 0.206 1.601,
0.01818 0.9788 0.2039 1.68,
-0.002634 0.9797 0.2005 1.752,
-0.01674 0.9803 0.1968 1.8,
-0.03139 0.9809 0.1921 1.845,
-0.04582 0.9813 0.1868 1.888,
-0.05927 0.9817 0.1811 1.929,
-0.07101 0.9819 0.1754 1.97,
-0.08033 0.9822 0.1701 2.012,
-0.08655 0.9824 0.1653 2.054,
-0.08901 0.9829 0.1615 2.099,
-0.08519 0.9838 0.1578 2.161,
-0.07481 0.985 0.1553 2.225,
-0.06086 0.9863 0.1532 2.289,
-0.04611 0.9874 0.1512 2.355,
-0.03321 0.9883 0.1487 2.421,
-0.02464 0.9891 0.1453 2.486,
-0.02103 0.9897 0.1419 2.536,
-0.01849 0.9903 0.1378 2.586,
-0.01686 0.9909 0.1333 2.637,
-0.01599 0.9916 0.1287 2.688,
-0.01573 0.9921 0.1242 2.738,
-0.01593 0.9926 0.1202 2.789,
-0.01645 0.993 0.1169 2.839,
-0.01717 0.9933 0.1145 2.887,
-0.01892 0.9935 0.1124 2.949,
-0.02181 0.9936 0.1109 3.006,
-0.02542 0.9936 0.1103 3.062,
-0.02935 0.9934 0.1107 3.122,
-0.0332 0.9931 0.1124 3.187,
-0.03655 0.9926 0.1156 3.262,
-0.0389 0.9921 0.1195 3.328,
-0.04144 0.9913 0.1248 3.404,
-0.04404 0.9904 0.1311 3.484,
-0.04658 0.9893 0.1381 3.568,
-0.04895 0.9882 0.1454 3.65,
-0.05101 0.9869 0.1527 3.728,
-0.05262 0.9858 0.1597 3.799,
-0.05362 0.9847 0.1658 3.86,
-0.05364 0.9833 0.1736 3.924,
-0.05231 0.9819 0.1819 3.974,
-0.0502 0.9806 0.1897 4.016,
-0.04787 0.9794 0.1962 4.052,
-0.04592 0.9786 0.2007 4.088,
-0.04496 0.9783 0.2024 4.129,
-0.04502 0.9786 0.201 4.16,
-0.04554 0.9793 0.1974 4.187,
-0.04641 0.9803 0.1921 4.212,
-0.04748 0.9815 0.1856 4.239,
-0.04865 0.9827 0.1785 4.267,
-0.04978 0.984 0.1713 4.301,
-0.05075 0.985 0.1647 4.341,
-0.05144 0.9859 0.1591 4.39,
-0.052 0.9869 0.1526 4.472,
-0.05241 0.9879 0.1461 4.569,
-0.05267 0.9888 0.1394 4.675,
-0.05277 0.9898 0.1326 4.786,
-0.05272 0.9907 0.1257 4.895,
0.05251 -0.9915 -0.1189 1.284,
-0.05219 0.9918 0.1163 5.039,
-0.05152 0.9922 0.1136 5.078,
-0.05052 0.9925 0.111 5.118,
-0.04926 0.9929 0.1083 5.158,
-0.0478 0.9932 0.1057 5.198,
-0.0462 0.9936 0.103 5.238,
-0.04455 0.994 0.1003 5.277,
-0.04292 0.9943 0.09761 5.316,
-0.04143 0.9946 0.09486 5.355,
-0.04021 0.9949 0.09208 5.393,
-0.03938 0.9952 0.08926 5.431,
-0.03912 0.9955 0.0864 5.468,
-0.03963 0.9957 0.08351 5.505,
-0.04113 0.9959 0.08057 5.541,
0.04391 -0.996 -0.0776 0.7071,
0.05562 -0.9959 -0.07195 0.6454,
0.07728 -0.9948 -0.06624 0.5891,
0.1081 -0.9923 -0.06053 0.5364,
0.1468 -0.9876 -0.05482 0.4855,
0.1922 -0.9801 -0.04904 0.4342,
0.2431 -0.969 -0.04298 0.3806,
0.2997 -0.9534 -0.03619 0.3221,
0.3649 -0.9307 -0.02748 0.2563,
0.5108 -0.8597 -0.007514 0.1486,
0.9944 0.051 0.09282 0.04621,
0.06745 0.9956 0.06531 0.1394,
-0.1037 0.9934 0.049 0.2705,
-0.1578 0.9865 0.04335 0.3845,
-0.1777 0.9832 0.04141 0.4654 ]
}
]
}
DEF touchTrain TouchSensor {
}
DEF trainSoundEffectScript Script {
eventOut SFFloat mainintensity
eventOut SFFloat echointensity
eventOut SFTime startEffects
eventOut SFTime stopEffects
eventOut SFTime startTrainOut
eventOut SFTime echoStart
eventOut SFTime fadeStart
eventOut SFTime stopTrainOut
eventIn SFFloat echoFract
eventIn SFFloat fadeFract
eventIn SFTime startTrain
eventIn SFTime stopTrain
eventIn SFTime cycleTrain
field SFTime soundStart 0
field SFBool entering FALSE
url "vrmlscript:
function echoFract(value, time)
{
echointensity = value;
mainintensity = 1 - value;
}
function fadeFract(value, time)
{
echointensity = 1-value;
mainintensity = value;
}
function startTrain(value, time)
{
soundStart = value;
startTrainOut = value;
}
function stopTrain(value, time)
{
soundStart = 0;
stopTrainOut = value;
stopEffects = value;
}
function cycleTrain(value, time)
{
startEffects = value+18;
stopEffects = value+22;
echoStart = value+18.75;
fadeStart = value+21.25;
}
"
}
DEF trainGeomInline Transform {
children Inline {
url "trainGeomInline.wrl"
bboxCenter -95.9 -29.03 124.2
bboxSize 18.48 26.22 50.07
}
translation -523.8 -140.3 1291
rotation 0.2335 0.9639 0.1277 0.5917
scale 1 1 1
scaleOrientation 0.2476 0.9638 -0.09873 0.6145
center -95.9 -29.03 124.2
}
DEF trainSound Sound {
source DEF trainclip AudioClip {
url "train.wav"
loop TRUE
startTime 0
stopTime 1
}
intensity 1
location -614.5 -140.9 1444
direction 0.04565 -0.6118 0.7897
minFront 40
maxFront 400
minBack 40
maxBack 400
}
DEF trainEcho Sound {
source DEF trainEchoClip AudioClip {
url "trainTunnel.wav"
loop TRUE
startTime 0
stopTime 1
}
intensity 1
location -614 -142.3 1442
direction 0.04565 -0.6118 0.7897
minFront 40
maxFront 400
minBack 40
maxBack 400
}
DEF cabView Viewpoint {
position -629.3 -162.5 1402
orientation -0.02293 0.9925 0.1204 3.717
fieldOfView 0.7854
description "cabcam"
}
]
translation 0 0 0
rotation 0 0 1 0
scale 1 1 1
scaleOrientation 0 0 1 0
center -619.7 -169.4 1416
}
DEF terrainGeomInline Transform {
children Inline {
url "terrainGeom.wrl"
bboxCenter 3.959 -23.58 28.31
bboxSize 3195 327.2 3194
}
}
DEF tunnelGroup Transform {
children DEF tunnelGeomInline Transform {
children Inline {
url "tunnelGeomInline.wrl"
bboxCenter 6.695 -20.74 18.33
bboxSize 55.92 57.82 268.1
}
translation -598.4 -86.63 1055
rotation 0.2188 -0.9756 0.01611 0.4707
scale 1 1 1
scaleOrientation -0.1655 0.3749 -0.9122 0.5138
}
translation 0 48.66 6.274
rotation 1 0 0 0.04674
scale 1 1 1
}
DEF trackGroup Transform {
children Inline {
url "trackInline.wrl"
bboxCenter -271.8 -141.9 1203
bboxSize 819.7 389.5 746.1
}
}
DEF Light1 DirectionalLight {
intensity 0.7961
ambientIntensity 0.41
color 0.9737 1 0.9474
direction -0.7968 -0.1298 -0.5901
}
DEF VP2 Viewpoint {
position -748.6 -119.1 1333
orientation 0.0252 -0.9983 -0.05338 0.6548
fieldOfView 0.7854
description "tunnelView"
}
ROUTE trainSoundEffectScript.echoStart TO echoTimer.set_startTime
ROUTE trainSoundEffectScript.fadeStart TO fadeTimer.set_startTime
ROUTE touchTrain.touchTime TO trainTimer.set_startTime
ROUTE cabView.bindTime TO trainTimer.set_startTime
ROUTE trainTimer.fraction_changed TO trainGroupTranslationInterp.set_fraction
ROUTE trainTimer.fraction_changed TO trainGroupRotationInterp.set_fraction
ROUTE echoTimer.fraction_changed TO trainSoundEffectScript.echoFract
ROUTE fadeTimer.fraction_changed TO trainSoundEffectScript.fadeFract
ROUTE trainTimer.startTime_changed TO trainSoundEffectScript.startTrain
ROUTE trainTimer.cycleTime TO trainSoundEffectScript.cycleTrain
ROUTE trainSoundEffectScript.startTrainOut TO trainclip.set_startTime
ROUTE trainSoundEffectScript.stopTrainOut TO trainclip.set_stopTime
ROUTE trainSoundEffectScript.mainintensity TO trainSound.set_intensity
ROUTE trainSoundEffectScript.startEffects TO trainEchoClip.set_startTime
ROUTE trainSoundEffectScript.stopEffects TO trainEchoClip.set_stopTime
ROUTE trainSoundEffectScript.echointensity TO trainEcho.set_intensity
ROUTE trainGroupTranslationInterp.value_changed TO trainGroup.set_translation
ROUTE trainGroupRotationInterp.value_changed TO trainGroup.set_rotation