#V2.0 utf8 EXTERNPROTO product [ exposedField SFVec3f translation exposedField MFString coverPic ] ["@vr-web3d-willem-product.wrl#product"] EXTERNPROTO Logo [ exposedField SFVec3f translation exposedField SFVec3f scale ] ["@vr-web3d-willem-logo.wrl#Logo"] Transform { children [ DEF REMOVEINIT PositionInterpolator { key [0, 1] keyValue [0 0 0, 0 -5 0] } DEF INIT Transform { scale 0.3 0.3 0.3 children [ Shape { geometry Text { string ["Welcome to the iPod showroom!","Click above on an iPod model", "to see it!"] fontStyle FontStyle { justify "MIDDLE" } } } ] } ] } Transform { children[ DEF CALLWHITE PositionInterpolator { key [0, 1] keyValue [-10 0 0, -1.5 0 0] } DEF REMOVEWHITE PositionInterpolator { key [0, 1] keyValue [-1.5 0 0, -10 0 0] } DEF WHITEIPOD Transform { translation -10 0 0 children [ product { ##translation -1.5 0 0 } ] } ] } Transform { children [ DEF CALLBLACK PositionInterpolator { key [0, 1] keyValue [7 0 0, -1.5 0 0] } DEF REMOVEBLACK PositionInterpolator { key [0, 1] keyValue [-1.5 0 0, 7 0 0] } DEF BLACKIPOD Transform { translation 7 0 0 children [ product { ##translation 7 0 0 coverPic "ipodBlackFront.png" } ] } ] } Transform { children [ DEF CALLU2 PositionInterpolator { key [0, 1] keyValue [-1.5 5 0, -1.5 0 0] } DEF REMOVEU2 PositionInterpolator { key [0, 1] keyValue [-1.5 0 0, -1.5 5 0] } DEF U2IPOD Transform { translation -1.5 5 0 children [ product { ##translation -1.5 5 0 coverPic "ipodu2front.png" } ] } ] } Transform { scale 0.5 0.5 0.5 translation 0 1.5 0 children [ Transform { translation 0 0 0 children [ DEF WHITETOUCH TouchSensor { } Shape { geometry Text { string "white" } } ] } Transform { translation 3 0 0 children [ DEF BLACKTOUCH TouchSensor { } Shape { geometry Text { string "black" } } ] } Transform { translation -2 0 0 children [ DEF U2TOUCH TouchSensor { } Shape { geometry Text { string "U2" } } ] } ] } DEF CALLBLACKTIMER TimeSensor { cycleInterval 3 } DEF CALLWHITETIMER TimeSensor { cycleInterval 3 } DEF CALLU2TIMER TimeSensor { cycleInterval 3 } DEF REMOVEBLACKTIMER TimeSensor { cycleInterval 3 } DEF REMOVEWHITETIMER TimeSensor { cycleInterval 3 } DEF REMOVEU2TIMER TimeSensor { cycleInterval 3 } DEF REMOVEINITTIMER TimeSensor { cycleInterval 3 } DEF WHICHSCRIPT Script { eventIn SFTime setWhite eventIn SFTime setBlack eventIn SFTime setU2 field SFString currentIpod "none" eventOut SFTime goWhite eventOut SFTime goBlack eventOut SFTime goU2 eventOut SFTime goBlack2White eventOut SFTime goBlack2U2 eventOut SFTime goU22White eventOut SFTime goU22Black eventOut SFTime goWhite2Black eventOut SFTime goWhite2U2 url "javascript: function setWhite(value, time) { if(currentIpod == 'none') { currentIpod = 'white'; goWhite = value; } else if(currentIpod != 'white') { if(currentIpod == 'black') { currentIpod = 'white'; goBlack2White = value; } else { currentIpod = 'white'; goU22White = value; } } } function setBlack(value, time) { if(currentIpod == 'none') { currentIpod = 'black'; goBlack = value; } else if(currentIpod != 'black') { if(currentIpod == 'white') { currentIpod = 'black'; goWhite2Black = value; } else { currentIpod = 'black'; goU22Black = value; } } } function setU2(value, time) { if(currentIpod == 'none') { currentIpod = 'u2'; goU2 = value; } else if(currentIpod != 'u2') { if(currentIpod == 'white') { currentIpod = 'u2'; goWhite2U2 = value; } else { currentIpod = 'u2'; goBlack2U2 = value; } } } " } ## ROUTES FOR FIRST CALL ROUTE WHICHSCRIPT.goWhite TO CALLWHITETIMER.startTime ROUTE WHICHSCRIPT.goBlack TO CALLBLACKTIMER.startTime ROUTE WHICHSCRIPT.goU2 TO CALLU2TIMER.startTime ROUTE WHICHSCRIPT.goWhite TO REMOVEINITTIMER.startTime ROUTE WHICHSCRIPT.goBlack TO REMOVEINITTIMER.startTime ROUTE WHICHSCRIPT.goU2 TO REMOVEINITTIMER.startTime ROUTE REMOVEINITTIMER.fraction_changed TO REMOVEINIT.set_fraction ROUTE REMOVEINIT.value_changed TO INIT.set_translation ## ROUTES FOR WHITE2BLACK and U22BLACK ROUTE BLACKTOUCH.touchTime TO WHICHSCRIPT.setBlack ROUTE WHICHSCRIPT.goWhite2Black TO CALLBLACKTIMER.startTime ROUTE WHICHSCRIPT.goU22Black TO CALLBLACKTIMER.startTime ROUTE WHICHSCRIPT.goWhite2Black TO REMOVEWHITETIMER.startTime ROUTE WHICHSCRIPT.goU22Black TO REMOVEU2TIMER.startTime ROUTE CALLBLACKTIMER.fraction_changed TO CALLBLACK.set_fraction ROUTE CALLBLACK.value_changed TO BLACKIPOD.set_translation ## ROUTES FOR BLACK2WHITE and U22WHITE ROUTE WHITETOUCH.touchTime TO WHICHSCRIPT.setWhite ROUTE WHICHSCRIPT.goBlack2White TO CALLWHITETIMER.startTime ROUTE WHICHSCRIPT.goU22White TO CALLWHITETIMER.startTime ROUTE WHICHSCRIPT.goBlack2White TO REMOVEBLACKTIMER.startTime ROUTE WHICHSCRIPT.goU22White TO REMOVEU2TIMER.startTime ROUTE CALLWHITETIMER.fraction_changed TO CALLWHITE.set_fraction ROUTE CALLWHITE.value_changed TO WHITEIPOD.set_translation ## ROUTES FOR WHITE2U2 and BLACK2U2 ROUTE U2TOUCH.touchTime TO WHICHSCRIPT.setU2 ROUTE WHICHSCRIPT.goWhite2U2 TO CALLU2TIMER.startTime ROUTE WHICHSCRIPT.goBlack2U2 TO CALLU2TIMER.startTime ROUTE WHICHSCRIPT.goWhite2U2 TO REMOVEWHITETIMER.startTime ROUTE WHICHSCRIPT.goBlack2U2 TO REMOVEBLACKTIMER.startTime ROUTE CALLU2TIMER.fraction_changed TO CALLU2.set_fraction ROUTE CALLU2.value_changed TO U2IPOD.set_translation #remove routes ROUTE REMOVEWHITETIMER.fraction_changed TO REMOVEWHITE.set_fraction ROUTE REMOVEWHITE.value_changed TO WHITEIPOD.set_translation ROUTE REMOVEU2TIMER.fraction_changed TO REMOVEU2.set_fraction ROUTE REMOVEU2.value_changed TO U2IPOD.set_translation ROUTE REMOVEBLACKTIMER.fraction_changed TO REMOVEBLACK.set_fraction ROUTE REMOVEBLACK.value_changed TO BLACKIPOD.set_translation ## ## Logo placing Logo{ translation 2 -1.5 0 scale 0.5 0.5 0.5 } Viewpoint { position 0 0 5 } NavigationInfo { ##type "NONE" }