media @ VU
[] readme course(s) preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthought(s) appendix reference(s) example(s) resource(s) _

talk show tell print

web3d-willem-product.vr

web3d-willem-product.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  
  
  EXTERNPROTO Logo [
      exposedField SFVec3f translation
      exposedField SFVec3f scale
  ]
  ["@vr-web3d-willem-logo.wrl#Logo"]
  
  EXTERNPROTO ipod [
      exposedField SFVec3f scale
      exposedField SFVec3f translation
      exposedField MFString coverPic
  ]
  ["@vr-web3d-willem-ipod.wrl#ipod"]
  
  EXTERNPROTO Frame [
      exposedField MFVec3f spine
      exposedField MFVec2f crossSection
      exposedField SFVec3f translation
      exposedField SFVec3f scale
      exposedField SFRotation rotation
  ]
  ["@vr-web3d-willem-frame.wrl#Frame"]
  
  
  
  PROTO monitor [
      exposedField SFVec3f translation 0 0 0
      exposedField SFVec3f scale 1 1 1
      eventIn MFString string 
  ]
  
  {
      Transform {
            translation IS translation
            scale IS scale
            children [
                  Shape {
                      appearance Appearance {
                            material Material { 
                                  diffuseColor 1 1 1 
                            }
                      }
                      geometry DEF text Text { 
                            string [ "click on an element", "of the iPod to get some", "information about that", "element or click the blue", "sphere for a guided tour!" ] 
                            fontStyle FontStyle {
                                  justify "MIDDLE"
                            }
                      } 
                      
                  }
                  
            ]
      }
      
      Script {
            directOutput TRUE
            eventIn MFString string IS string
            field SFNode text USE text
            url "vrmlscript: 
            function string(value,time) { text.string = value; }
            "
      }
      
  } 
  
  PROTO product[
      exposedField SFVec3f translation 0 0 0
      exposedField MFString coverPic "ipodfront2.png"
  ]
  {
      
      
      
      
      
      ## iPod placing
      
      Transform {
            translation IS translation
            children [
                  DEF TIMER TimeSensor {
                      cycleInterval 40
                      
                  }
                  DEF FRAMESCRIPT Script {
                      eventIn SFTime screenTouch
                      eventIn SFTime clickWheelTouch
                      eventIn SFTime holdButtonTouch
                      eventIn SFTime headPhoneTouch
                      eventIn SFTime dockTouch
                      
                      eventIn SFFloat animationFrameInfo
                      
                      eventOut SFInt32 output
                      
                      
                      
                      url "javascript:
                      function initialize() {
                            output = -1;
                      }
                      function screenTouch(value, time) {
                            output = 0;
                      }
                      function clickWheelTouch(value, time) {
                            output = 1;
                      }
                      function holdButtonTouch(value, time) {
                            output = 2;
                      }
                      function headPhoneTouch(value, time) {
                            output = 3;
                      }
                      function dockTouch(value, time) {
                            output = 4;
                      }
                      
                      function animationFrameInfo(value, time) {
                            if(value < 0.1) {
                                  output = -1;
                            } else if(value < 0.2) {
                                  output = 0;
                            } else if(value < 0.3) {
                                  output = 1;
                            } else if(value < 0.4) {
                                  output = 1;
                            } else if(value < 0.5) {
                                  output = 2;
                            } else if(value < 0.6) {
                                  output = 3;
                            } else if(value < 0.75) {
                                  output = 4;
                            } else {
                                  output = -1;
                            }        
                      }
                      
                      
                      "
                      
                  }
                  
                  
                  
                  
                  DEF SCRIPT Script {
                      directOutput TRUE
                      eventIn SFTime screenTouch
                      eventIn SFTime clickWheelTouch
                      eventIn SFTime holdButtonTouch
                      eventIn SFTime headPhoneTouch
                      eventIn SFTime dockInputTouch
                      
                      eventIn SFFloat animationScreenInfo
                      
                      eventOut MFString result
                      field MFString screenInfo ["This is the display.", "It can display photos, videos", "and, of course, the song", "you're playing."]
                      field MFString clickWheelInfo ["This is the clickwheel.", "Use the buttons to browse", "through your music."]
                      field MFString backInfo ["This is the backside", "of the iPod."]
                      field MFString holdButtonInfo ["This is the hold button. ", "When your iPod is on hold,","no other buttons can be used."]
                      field MFString headPhoneInfo ["This is where the headphones", "go into your iPod."]
                      field MFString dockInputInfo ["This is where you place your", "iPod in your Dock or where", "you put the cable that", "connects your iPod to", "your computer."]
                      
                      field MFString animInfoStart ["Welcome to this iPod", "guided tour.", "We will show you what elements", "this iPod consists of."]
                      field MFString animInfoEnd ["This concludes the iPod", "guided tour.", "Thank you for your attention."]
                      field MFString reset [ "click on an element", "of the iPod to get some", "information about that", "element or click the blue", "sphere for a guided tour!" ]
                      
                      url "javascript:
                      
                      function screenTouch(value, time) {
                            result = screenInfo;
                      }
                      function clickWheelTouch(value, time) {
                            result = clickWheelInfo;
                      }
                      function holdButtonTouch(value, time) {
                            result = holdButtonInfo;
                      }
                      function headPhoneTouch(value, time) {
                            result = headPhoneInfo;
                      }
                      function dockInputTouch(value, time) {
                            result = dockInputInfo;
                      }
                      function animationScreenInfo(value, time) {
                            if(value < 0.1) {
                                  result = animInfoStart;
                            } else if(value < 0.2) {
                                  result = screenInfo;
                            } else if(value < 0.3) {
                                  result = clickWheelInfo;
                            } else if(value < 0.4) {
                                  result = backInfo;
                            } else if(value < 0.5) {
                                  result = holdButtonInfo;
                            } else if(value < 0.6) {
                                  result = headPhoneInfo;
                            } else if(value < 0.75) {
                                  result = dockInputInfo;
                            } else if(value < 1){
                                  result = animInfoEnd;
                            } else {
                                  result = reset;
                            }                
                      }
                      
                      
                      
                      "
                      
                  }
                  
                  DEF SENSOR SphereSensor {
                  }
                  
                  DEF ORIINT OrientationInterpolator {
                      key [0, 0.1, 0.2, 0.3, 0.34, 0.4, 0.43, 0.5, 0.6, 0.62, 0.75, 1.0]
                      keyValue [
                            0 1 0 0      
                            0 1 0 0.1
                            0 1 0 0
                            0 0 1 0.3
                            0 1 0 3.14
                            0 1 0 3.00
                            1 0 0 1.57
                            1 0 0 1.40
                            1 0 0 1.57
                            1 0 0 4.71
                            1 0 0 4.60
                            1 0 0 6.28
                            
                      ]
                      
                  }
                  
                  DEF IPOD Transform {
                      children [
                            ipod{
                                  coverPic IS coverPic
                            }
                            
                            
                            
                            Transform { ##iPod screen
                                  translation 0.028 0.67 0.15
                                  children [
                                      DEF SCREENTOUCH TouchSensor {
                                      }
                                      
                                      Shape {
                                            appearance Appearance {
                                                  material Material {
                                                      
                                                  }
                                                  texture DEF MOVIE MovieTexture {
                                                      url "the_wall_1.mpg"
                                                      speed 0.5
                                                      
                                                  }
                                            }
                                            geometry Box {
                                                  size 1.30 0.98 0.000001
                                            }
                                      }
                                      
                                  ]
                            }
                            
                            
                            
                            
                            
                            
                            Transform { ##iPod clickWheel
                                  translation 0.05 -0.55 0.2
                                  scale 1 1 0.000001
                                  children [
                                      DEF CLICKWHEELTOUCH TouchSensor {
                                      }
                                      Shape {
                                            appearance Appearance {
                                                  material Material {
                                                      transparency 1
                                                  }
                                            }
                                            geometry Box { ## better than a sphere
                                                  size 1 1 0.000001
                                            }
                                      }
                                  ]
                            }
                            
                            
                            Transform { ##hold button
                                  translation -0.4 1.3 0
                                  children [
                                      DEF HOLDBUTTONTOUCH TouchSensor {
                                      }
                                      Shape {
                                            appearance Appearance {
                                                  texture ImageTexture {
                                                      url "hold.png"
                                                  }
                                            }
                                            
                                            geometry Box {
                                                  size 0.5 0.000001 0.15
                                            }
                                      }
                                  ]
                            }
                            Transform { ##headphone input
                                  translation 0.5 1.3 0
                                  children [
                                      DEF HEADPHONETOUCH TouchSensor {
                                      }
                                      Shape {
                                            appearance Appearance {
                                                  texture ImageTexture {
                                                      url "micInput.png"
                                                  }
                                                  
                                            }
                                            geometry Box {
                                                  size 0.25 0.000001 0.15
                                            }
                                      }
                                  ]
                            }
                            Transform { ##dock input
                                  translation 0 -1.3 0
                                  children [
                                      DEF DOCKINPUTTOUCH TouchSensor {
                                      }
                                      Shape {
                                            appearance Appearance {
                                                  texture ImageTexture {
                                                      url "dockInput.png"
                                                  }
                                            }
                                            geometry Box {
                                                  size 0.5 0.000001 0.15
                                            }
                                            
                                      }
                                  ]
                            }
                            
                            DEF SWITCH Switch {
                                  
                                  choice [
                                      
                                      Frame { ## around the display
                                            translation -0.625 0.18 0.1
                                            scale 0.13 0.1 0.1
                                            #spine [0 0 0, 0 9 0, 13 9 0, 13 0 0, 0 0 0]
                                            
                                      }
                                      
                                      Frame { ## around the clickWheel
                                            translation -0.5 -1.05 0.1
                                            
                                      }
                                      Frame { ## around the hold button
                                            translation -0.67 1.32 -0.09
                                            scale 0.05 0.02 0.1
                                            rotation 1 0 0 1.57
                                            #spine [0 0 0, 0 1.2 0, 6 1.2 0, 6 0 0, 0 0 0]
                                      }
                                      Frame { ## around the headphones input
                                            translation 0.37 1.32 -0.09
                                            scale 0.03 0.02 0.1
                                            rotation 1 0 0 1.57
                                            #spine [0 0 0, 0 1.2 0, 2 1.2 0, 2 0 0, 0 0 0]
                                      }
                                      Frame { ## around the dock input
                                            translation -0.27 -1.27 -0.09
                                            scale 0.05 0.02 0.1
                                            rotation 1 0 0 1.57
                                            #spine [0 0 0, 0 1.2 0, 6 1.2 0, 6 0 0, 0 0 0]
                                      }
                                  ]
                            }
                            
                            
                            
                            
                            
                      ]
                  }
                  
                  Transform {
                      translation -0.05 -1.8 0
                      scale 0.2 0.2 0.2
                      children [
                            DEF ANIMATIONTOUCH TouchSensor {
                            }
                            Shape {
                                  appearance Appearance {
                                      material Material {
                                            diffuseColor 0.1 0 1
                                      }
                                  }
                                  geometry Sphere {
                                  }
                            }
                      ]
                      
                  }
                  ## Monitor placing
                  DEF MON monitor { 
                      scale 0.3 0.3 0.3
                      translation 2.7 1 0
                  }
                  
            ]
      }
      
      
      
      
      ROUTE SENSOR.rotation_changed TO IPOD.rotation
      
      ROUTE SCREENTOUCH.touchTime TO SCRIPT.screenTouch
      ROUTE CLICKWHEELTOUCH.touchTime TO SCRIPT.clickWheelTouch
      ROUTE HOLDBUTTONTOUCH.touchTime TO SCRIPT.holdButtonTouch
      ROUTE HEADPHONETOUCH.touchTime TO SCRIPT.headPhoneTouch
      ROUTE DOCKINPUTTOUCH.touchTime TO SCRIPT.dockInputTouch
      
      ROUTE SCREENTOUCH.touchTime TO FRAMESCRIPT.screenTouch
      ROUTE CLICKWHEELTOUCH.touchTime TO FRAMESCRIPT.clickWheelTouch
      ROUTE HOLDBUTTONTOUCH.touchTime TO FRAMESCRIPT.holdButtonTouch
      ROUTE HEADPHONETOUCH.touchTime TO FRAMESCRIPT.headPhoneTouch
      ROUTE DOCKINPUTTOUCH.touchTime TO FRAMESCRIPT.dockTouch
      
      ROUTE FRAMESCRIPT.output TO SWITCH.whichChoice
      ROUTE SCREENTOUCH.touchTime TO MOVIE.startTime
      
      ROUTE SCRIPT.result TO MON.string
      
      ##animatie...
      
      ROUTE TIMER.fraction_changed TO ORIINT.set_fraction
      ROUTE ORIINT.value_changed TO IPOD.rotation
      
      ROUTE ANIMATIONTOUCH.touchTime TO TIMER.startTime
      ROUTE TIMER.fraction_changed TO SCRIPT.animationScreenInfo
      ROUTE TIMER.fraction_changed TO FRAMESCRIPT.animationFrameInfo
  }
  
  product {
      translation -1.5 0 0
  }
  
  
  
  Logo{ 
      translation 2 -1.5 0 
      scale 0.5 0.5 0.5
  }
  
  Viewpoint {
      position 0 0 5
  }
  
  NavigationInfo {
      type "NONE"
  }
    
  
    
  

(C) A. Eliëns 2/9/2007

You may not copy or print any of this material without explicit permission of the author or the publisher.
In case of other copyright issues, contact the author.