| 1 |
#X3D V3.2 utf8 |
| 2 |
PROFILE Interchange |
| 3 |
|
| 4 |
KambiNavigationInfo { |
| 5 |
type "EXAMINE" |
| 6 |
timeOriginAtLoad TRUE |
| 7 |
} |
| 8 |
|
| 9 |
Inline { url "plane.wrl" } |
| 10 |
|
| 11 |
DEF ChinTrans Transform { |
| 12 |
translation 0 0 0.2 |
| 13 |
children Inline { url "chinchilla_02k.wrl.gz" } |
| 14 |
} |
| 15 |
|
| 16 |
DEF Timer1 TimeSensor { cycleInterval 4.0 } |
| 17 |
DEF Interp PositionInterpolator { |
| 18 |
key [ 0 0.2 0.4 0.6 0.8 1 ] |
| 19 |
keyValue [ 0 0 0.2 |
| 20 |
-0.6 -0.6 0 |
| 21 |
0.6 -0.6 0 |
| 22 |
0.6 0.6 0 |
| 23 |
-0.6 0.6 0 |
| 24 |
0 0 0.2 ] |
| 25 |
} |
| 26 |
|
| 27 |
ROUTE Timer1.fraction_changed TO Interp.set_fraction |
| 28 |
ROUTE Interp.value_changed TO ChinTrans.set_translation |
| 29 |
|
| 30 |
DEF Timer2 TimeSensor { |
| 31 |
cycleInterval 2 |
| 32 |
startTime -1 stopTime -0.5 # don't play at start |
| 33 |
} |
| 34 |
DEF Orient OrientationInterpolator { |
| 35 |
key [ 0 0.5 1 ] |
| 36 |
keyValue [ 0.3 0.4 0.5 0.1, |
| 37 |
0.5 0.4 0.3 1.5, |
| 38 |
0.3 0.4 0.5 6.2831853072, # 2*pi |
| 39 |
] |
| 40 |
} |
| 41 |
|
| 42 |
ROUTE Timer2.fraction_changed TO Orient.set_fraction |
| 43 |
ROUTE Orient.value_changed TO ChinTrans.rotation |
| 44 |
|
| 45 |
# trivial script, just run timer2 when timer1 sends isActive = false |
| 46 |
# and the other way around |
| 47 |
DEF Scr Script { |
| 48 |
inputOnly SFBool timer_1_active |
| 49 |
inputOnly SFBool timer_2_active |
| 50 |
outputOnly SFTime timer_1_start |
| 51 |
outputOnly SFTime timer_2_start |
| 52 |
url "castlescript: |
| 53 |
|
| 54 |
function timer_1_active(value, time) |
| 55 |
when ( not(value), timer_2_start := time) |
| 56 |
|
| 57 |
function timer_2_active(value, time) |
| 58 |
when ( not(value), timer_1_start := time) |
| 59 |
" |
| 60 |
} |
| 61 |
|
| 62 |
ROUTE Timer1.isActive TO Scr.timer_1_active |
| 63 |
ROUTE Scr.timer_2_start TO Timer2.startTime |
| 64 |
ROUTE Timer2.isActive TO Scr.timer_2_active |
| 65 |
ROUTE Scr.timer_1_start TO Timer1.startTime |