#VRML V2.0 utf8 # Ass. 2 MULTIMEDIA AUTHORING 2007-2008 WorldInfo { title "Product" info ["(C) Copyright 2007 V.G. Stolte & " "Nick Peterman"] } NavigationInfo { headlight TRUE type "EXAMINE" } EXTERNPROTO logo [ field SFColor textcolor field SFFloat doorzichtigheid ] ["logo.wrl"] Transform { translation 11 -2 6 rotation 1 0 0 -1.1 scale 0.5 0.5 0.5 children [ logo { textcolor 1 1 1 } ] } Anchor { children [ Transform { translation -3.5 -2 1 children [ DEF POSTOUCH TouchSensor {} Shape { appearance Appearance { material Material { diffuseColor 1 1 1 } } appearance Appearance { texture ImageTexture { url "back.jpg" } } geometry Box { size 1 1 .5 } } DEF ts TouchSensor {} DEF MP30 Transform { children [ Sound { ##minFront 10 ##minBack 10 ##maxFront 50 ##maxBack 50 source DEF SOUND AudioClip { loop FALSE startTime 0 stopTime 0 pitch 1 url "music1.wav" } } ] } ] } ] } ROUTE ts.touchTime TO SOUND.startTime ROUTE POSTOUCH.hitPoint_changed TO MP30.translation Anchor { children [ Transform { translation -.5 -2 1 children [ DEF POSTOUCH1 TouchSensor {} Shape { appearance Appearance { material Material { diffuseColor 1 1 1 } texture ImageTexture { url "forward.jpg" } } geometry Box { size 1 1 .5 } } DEF ts1 TouchSensor {} DEF MP31 Transform { children [ Sound { ##minFront 10 ##minBack 10 ##maxFront 50 ##maxBack 50 source DEF SOUND1 AudioClip { url "music2.wav" loop FALSE startTime 0 stopTime 0 pitch 1 } } ] } ] } ] } ROUTE ts1.touchTime TO SOUND1.startTime ROUTE POSTOUCH1.hitPoint_changed TO MP31.translation Anchor { children [ Transform { translation 3 -1 1 children [ DEF POSTOUCH2 TouchSensor {} Shape { appearance Appearance { material Material { diffuseColor 1 1 1 } } geometry Sphere { radius 1 } } DEF ts2 TouchSensor {} DEF MP32 Transform { children [ Sound { minFront 10 minBack 100 maxFront 50 maxBack 500 source DEF SOUND2 AudioClip { url "pop.wav" ## deze niet verandere is wat "harder" loop FALSE startTime 0 stopTime 0 pitch 1 } } ] } ] } ] } ROUTE ts2.touchTime TO SOUND2.startTime ROUTE POSTOUCH2.hitPoint_changed TO MP32.translation Transform { translation 0 -.5 0 children [ Shape { appearance Appearance { material Material { diffuseColor 0 0 0 } } geometry Box { size 9 5 2 } } ] } Transform { translation 0 1 1.1 children [ Shape { geometry Box { size 7 1 0 } } ] } ## code voor eventueel meer nummers/plaatjes, Laat staan! DEF CYCLE Script { eventIn SFTime touchTime field SFInt32 number 3 eventOut SFInt32 output url "javascript: function initialize() { output = 0; } function touchTime(value, time) { if (output == number - 1) output = 1; else ++output; } " } DEF SWITCH Switch { whichChoice 0 choice [ Transform { translation 0 1 1.1 children [ Shape { geometry Box { size 7 1 0 } } ] } Transform { translation 0 1 1.1 children [ Shape { appearance Appearance { texture ImageTexture { url "plaatje1.jpg" } } geometry Box { size 7 1 0 } } ] } Transform { translation 0 1 1.1 children [ Shape { appearance Appearance { texture ImageTexture { url "plaatje2.jpg" } } geometry Box { size 7 1 0 } } ] } ] } ROUTE POSTOUCH.touchTime TO CYCLE.touchTime ROUTE CYCLE.output TO SWITCH.whichChoice ROUTE POSTOUCH1.touchTime TO CYCLE.touchTime ROUTE CYCLE.output TO SWITCH.whichChoice ROUTE ts.touchTime TO SOUND.stopTime ROUTE ts.touchTime TO SOUND.set_startTime ROUTE ts.touchTime TO SOUND1.stopTime ROUTE ts1.touchTime TO SOUND1.stopTime ROUTE ts1.touchTime TO SOUND1.set_startTime ROUTE ts1.touchTime TO SOUND.stopTime Anchor { children [ Transform { translation 0 5 0 children [ Shape { appearance Appearance { material Material { diffuseColor 1 0 0 emissiveColor 1 .5 0 } } geometry Text { string "MP3 Player:" fontStyle FontStyle { size 1 justify "MIDDLE" } } } ] } ] description "beschrijving" url "http://www.nl.bol.com/is-bin/INTERSHOP.enfinity/eCS/Store/nl/-/EUR/BOL_DisplayProductInformation-Start?BOL_OWNER_ID=9000000005538279&Section=SCE" } Transform { translation 0 4 0 children [ Shape { appearance Appearance { material Material { diffuseColor 1 0 0 emissiveColor 1 .5 0 } } geometry Text { string "Press some buttons for a preview:" fontStyle FontStyle { size 1 justify "MIDDLE" } } } ] } Transform { translation -5 -.6 0 children [ Shape { appearance Appearance { material Material { diffuseColor 0.5 0.5 0.5 } } geometry Box { size 1 1 1 } } ] } Transform { translation -4 1.6 -0 children [ Shape { appearance Appearance { material Material { emissiveColor 1 1 1 transparency 0.5 } } geometry Box { size .5 1 1 } } ] } Transform { translation 4 -.6 0 children [ Shape { appearance Appearance { material Material { emissiveColor 1 0 0 } } geometry Sphere { radius 0.55 } } ] } Viewpoint { position 5 0 15 } Background { skyColor 0.5 0.5 1 } Transform { children [ DEF toc-switch-1-0 Switch { whichChoice -1 choice [ DEF toc-transform-1-0 Transform { translation 0 0 0 scale 1 1 1 rotation 0 1 0 0 children [ Text { string "text" fontStyle FontStyle { justify "MIDDLE" } } ] } ] } ## end switch Transform { translation -1 -1.5 5 children [ Shape { appearance Appearance { material DEF toc-mat-1-0 Material { diffuseColor 1 0 0 transparency 1 } } geometry Text { string "Back" fontStyle FontStyle { size .8 justify "MIDDLE" } } } DEF toc-touch-1-0 TouchSensor { } ] } Transform { translation -2 -.5 5 children [ Shape { appearance Appearance { material DEF toc-mat-1-00 Material { diffuseColor 1 0 0 transparency 1 } } geometry Text { string "USB" fontStyle FontStyle { size .8 justify "MIDDLE" } } } DEF toc-touch-1-00 TouchSensor { } ] } DEF toc-script-1-0 Script { directOutput TRUE field SFNode me USE toc-script-1-0 field SFNode xswitch USE toc-switch-1-0 field SFNode transform USE toc-transform-1-0 field SFNode sensor USE toc-touch-1-0 field SFNode mat USE toc-mat-1-0 field SFInt32 state 0 eventIn SFBool touch eventIn SFBool over url "vrmlscript: function initialize() { Browser.addRoute(sensor,'isActive',me,'touch'); Browser.addRoute(sensor,'isOver',me,'over'); } function shutdown() { Browser.deleteRoute(sensor,'isActive',me,'touch'); Browser.deleteRoute(sensor,'isOver',me,'over'); } function touch(value,time) { if (value && state == 0) { xswitch.whichChoice = 0; //transform.translation = new SFVec3f(1.5,1,0); transform.scale = new SFVec3f(0.8,0.8,1); state = 1; } else if (value && state == 1) { //transform.translation = new SFVec3f(0,0,0); transform.scale = new SFVec3f(5,5,1); state = 2; } else if (value && state == 2) { xswitch.whichChoice = -1; view.position = new SFVec3f(0,0,10); state = 0; } } function over(value,time) { if (value) { mat.transparency = 0.5; } else { mat.transparency = 1; } } " } ] } DEF toc-script-1-00 Script { directOutput TRUE field SFNode me USE toc-script-1-00 field SFNode xswitch USE toc-switch-1-00 field SFNode transform USE toc-transform-1-00 field SFNode sensor USE toc-touch-1-00 field SFNode mat USE toc-mat-1-00 field SFInt32 state 0 eventIn SFBool touch eventIn SFBool over url "vrmlscript: function initialize() { Browser.addRoute(sensor,'isActive',me,'touch'); Browser.addRoute(sensor,'isOver',me,'over'); } function shutdown() { Browser.deleteRoute(sensor,'isActive',me,'touch'); Browser.deleteRoute(sensor,'isOver',me,'over'); } function touch(value,time) { if (value && state == 0) { xswitch.whichChoice = 0; //transform.translation = new SFVec3f(1.5,1,0); transform.scale = new SFVec3f(0.8,0.8,1); state = 1; } else if (value && state == 1) { //transform.translation = new SFVec3f(0,0,0); transform.scale = new SFVec3f(5,5,1); state = 2; } else if (value && state == 2) { xswitch.whichChoice = -1; view.position = new SFVec3f(0,0,10); state = 0; } } function over(value,time) { if (value) { mat.transparency = 0.5; } else { mat.transparency = 1; } } " } Transform { translation 3.5 -.75 5 children [ Shape { appearance Appearance { material DEF toc-mat-1-0000 Material { diffuseColor 1 0 0 transparency 1 } } geometry Text { string "Volume" fontStyle FontStyle { size .8 justify "MIDDLE" } } } DEF toc-touch-1-0000 TouchSensor { } ] } DEF toc-script-1-0000 Script { directOutput TRUE field SFNode me USE toc-script-1-0000 field SFNode xswitch USE toc-switch-1-0 field SFNode transform USE toc-transform-1-0 field SFNode sensor USE toc-touch-1-0000 field SFNode mat USE toc-mat-1-0000 field SFInt32 state 0 eventIn SFBool touch eventIn SFBool over url "vrmlscript: function initialize() { Browser.addRoute(sensor,'isActive',me,'touch'); Browser.addRoute(sensor,'isOver',me,'over'); } function shutdown() { Browser.deleteRoute(sensor,'isActive',me,'touch'); Browser.deleteRoute(sensor,'isOver',me,'over'); } function touch(value,time) { if (value && state == 0) { xswitch.whichChoice = 0; //transform.translation = new SFVec3f(1.5,1,0); transform.scale = new SFVec3f(0.8,0.8,1); state = 1; } else if (value && state == 1) { //transform.translation = new SFVec3f(0,0,0); transform.scale = new SFVec3f(5,5,1); state = 2; } else if (value && state == 2) { xswitch.whichChoice = -1; view.position = new SFVec3f(0,0,10); state = 0; } } function over(value,time) { if (value) { mat.transparency = 0.5; } else { mat.transparency = 1; } } " } DEF toc-script-1-000 Script { directOutput TRUE field SFNode me USE toc-script-1-00 field SFNode xswitch USE toc-switch-1-0 field SFNode transform USE toc-transform-1-0 field SFNode sensor USE toc-touch-1-00 field SFNode mat USE toc-mat-1-00 field SFInt32 state 0 eventIn SFBool touch eventIn SFBool over url "vrmlscript: function initialize() { Browser.addRoute(sensor,'isActive',me,'touch'); Browser.addRoute(sensor,'isOver',me,'over'); } function shutdown() { Browser.deleteRoute(sensor,'isActive',me,'touch'); Browser.deleteRoute(sensor,'isOver',me,'over'); } function touch(value,time) { if (value && state == 0) { xswitch.whichChoice = 0; //transform.translation = new SFVec3f(1.5,1,0); transform.scale = new SFVec3f(0.8,0.8,1); state = 1; } else if (value && state == 1) { //transform.translation = new SFVec3f(0,0,0); transform.scale = new SFVec3f(5,5,1); state = 2; } else if (value && state == 2) { xswitch.whichChoice = -1; view.position = new SFVec3f(0,0,10); state = 0; } } function over(value,time) { if (value) { mat.transparency = 0.5; } else { mat.transparency = 1; } } " } Transform { translation 1.5 .5 5 children [ Shape { appearance Appearance { material DEF toc-mat-1-000 Material { diffuseColor 1 0 0 transparency 1 } } geometry Text { string "View Screen" fontStyle FontStyle { size .8 justify "MIDDLE" } } } DEF toc-touch-1-000 TouchSensor { } ] } DEF toc-script-1-000 Script { directOutput TRUE field SFNode me USE toc-script-1-000 field SFNode xswitch USE toc-switch-1-0 field SFNode transform USE toc-transform-1-0 field SFNode sensor USE toc-touch-1-000 field SFNode mat USE toc-mat-1-000 field SFInt32 state 0 eventIn SFBool touch eventIn SFBool over url "vrmlscript: function initialize() { Browser.addRoute(sensor,'isActive',me,'touch'); Browser.addRoute(sensor,'isOver',me,'over'); } function shutdown() { Browser.deleteRoute(sensor,'isActive',me,'touch'); Browser.deleteRoute(sensor,'isOver',me,'over'); } function touch(value,time) { if (value && state == 0) { xswitch.whichChoice = 0; //transform.translation = new SFVec3f(1.5,1,0); transform.scale = new SFVec3f(0.8,0.8,1); state = 1; } else if (value && state == 1) { //transform.translation = new SFVec3f(0,0,0); transform.scale = new SFVec3f(5,5,1); state = 2; } else if (value && state == 2) { xswitch.whichChoice = -1; view.position = new SFVec3f(0,0,10); state = 0; } } function over(value,time) { if (value) { mat.transparency = 0.5; } else { mat.transparency = 1; } } " } DEF toc-script-1-00000 Script { directOutput TRUE field SFNode me USE toc-script-1-00 field SFNode xswitch USE toc-switch-1-00000 field SFNode transform USE toc-transform-1-000 field SFNode sensor USE toc-touch-1-0000 field SFNode mat USE toc-mat-1-0000 field SFInt32 state 0 eventIn SFBool touch eventIn SFBool over } Transform { translation 1 -1.5 5 children [ Shape { appearance Appearance { material DEF toc-mat-1-00000 Material { diffuseColor 1 0 0 transparency 1 } } geometry Text { string "Forward" fontStyle FontStyle { size .8 justify "MIDDLE" } } } DEF toc-touch-1-00000 TouchSensor { } ] } DEF toc-script-1-000000 Script { directOutput TRUE field SFNode me USE toc-script-1-000000 field SFNode xswitch USE toc-switch-1-0 field SFNode transform USE toc-transform-1-0 field SFNode sensor USE toc-touch-1-00000 field SFNode mat USE toc-mat-1-00000 field SFInt32 state 0 eventIn SFBool touch eventIn SFBool over url "vrmlscript: function initialize() { Browser.addRoute(sensor,'isActive',me,'touch'); Browser.addRoute(sensor,'isOver',me,'over'); } function shutdown() { Browser.deleteRoute(sensor,'isActive',me,'touch'); Browser.deleteRoute(sensor,'isOver',me,'over'); } function touch(value,time) { if (value && state == 0) { xswitch.whichChoice = 0; //transform.translation = new SFVec3f(1.5,1,0); transform.scale = new SFVec3f(0.8,0.8,1); state = 1; } else if (value && state == 1) { //transform.translation = new SFVec3f(0,0,0); transform.scale = new SFVec3f(5,5,1); state = 2; } else if (value && state == 2) { xswitch.whichChoice = -1; view.position = new SFVec3f(0,0,10); state = 0; } } function over(value,time) { if (value) { mat.transparency = 0.5; } else { mat.transparency = 1; } } " } Transform { translation 7 -.5 5 children [ Shape { appearance Appearance { material DEF toc-mat-1-000000 Material { diffuseColor 1 0 0 transparency 1 } } geometry Text { string "insert headphone" fontStyle FontStyle { size .8 justify "MIDDLE" } } } DEF toc-touch-1-000000 TouchSensor { } ] } DEF toc-script-1-0000000 Script { directOutput TRUE field SFNode me USE toc-script-1-0000000 field SFNode xswitch USE toc-switch-1-0 field SFNode transform USE toc-transform-1-0 field SFNode sensor USE toc-touch-1-000000 field SFNode mat USE toc-mat-1-000000 field SFInt32 state 0 eventIn SFBool touch eventIn SFBool over url "vrmlscript: function initialize() { Browser.addRoute(sensor,'isActive',me,'touch'); Browser.addRoute(sensor,'isOver',me,'over'); } function shutdown() { Browser.deleteRoute(sensor,'isActive',me,'touch'); Browser.deleteRoute(sensor,'isOver',me,'over'); } function touch(value,time) { if (value && state == 0) { xswitch.whichChoice = 0; //transform.translation = new SFVec3f(1.5,1,0); transform.scale = new SFVec3f(0.8,0.8,1); state = 1; } else if (value && state == 1) { //transform.translation = new SFVec3f(0,0,0); transform.scale = new SFVec3f(5,5,1); state = 2; } else if (value && state == 2) { xswitch.whichChoice = -1; view.position = new SFVec3f(0,0,10); state = 0; } } function over(value,time) { if (value) { mat.transparency = 0.5; } else { mat.transparency = 1; } } " }