media @ VU
[] readme course preface I 1 2 II 3 4 III 5 6 7 IV 8 9 10 V 11 12 afterthoughts appendix references examples resources _

talk show tell print

example-zapata.vr

example-zapata.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  
  
  DEF view Viewpoint { position 0 0 10 }
  
  Background {
  skyColor 1 1 1
  }
  NavigationInfo {
  type ["EXAMINE", "ANY"]
  }
  
    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
    }
    ] } ## end switch
    
    
    Transform {
    children [
    Shape {
    appearance Appearance {
    material  Material {
            diffuseColor 1 1 0
            transparency 0
            }
    }
    geometry Box { size 3 3 0.5 }
    }
    DEF toc-touch-1-0 TouchSensor { }
    ] }
  
  #Panel
  DEF Panel Transform {
  translation 1 2 1
  children
  DEF main_P Panel {
  sticky TRUE #SITUACIÓN DE HTMLTEXT
  enabled TRUE
  backgroundTransparency 0 #Transparencia de fondo de htmltext
  backgroundColor 1 .5 0        #Color del fondo de htmltext
  borderColor 0 0 0 #BORDE DE HTMLTEXT
  borderSize 1 #TAMAÑO DEL BORDE DE HTMLTEXT
  source DEF main_HTXT HTMLText {           #NODO HTMLTEXT
  body ""
  padding [8,16,8,16]
  shadowTransparency 0
  }
  }
  }
  DEF main_SCR Script {
  field SFNode main_HTXT USE main_HTXT
  field SFString msg0 "Habitacion"
  url "javascript:
  function initialize(){
  main_HTXT.body = msg0;
  }
  
  "
  }
    
  
  DEF Panel2 Transform {
  translation 1 2 1
  children
  DEF main_P2 Panel {
  sticky TRUE #SITUACIÓN DE HTMLTEXT
  enabled TRUE
  backgroundTransparency 1 #Transparencia de fondo de htmltext
  backgroundColor 1 .5 0        #Color del fondo de htmltext
  borderColor 0 0 0 #BORDE DE HTMLTEXT
  borderSize 0 #TAMAÑO DEL BORDE DE HTMLTEXT
  source DEF main_HTXT2 HTMLText {           #NODO HTMLTEXT
  body ""
  padding [8,16,8,16]
  shadowTransparency 0
  }
  }
  }
  
  DEF main_kk Script {
  field SFNode main_HTXT2 USE main_HTXT2
  field SFString msg1 "XXX"
  url "javascript:
  function initialize(){
  main_HTXT2.body = msg1;
  }
  
  "
  }
  
    DEF toc-script-1-0 Script {
    field SFNode me USE toc-script-1-0
    field SFNode xswitch USE toc-switch-1-0
    field SFNode sensor USE toc-touch-1-0
    field SFNode main_P USE  main_HTXT
    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) { state = 0; } else if (value && state == 0) { state = 0; } else if (value && state == 0) { xswitch.whichChoice = 2;

                    state = 0;
                    }
            }
                     
  
            function over(value,time) {
                 
                            if (value) { 
                                                    main_P.shadowTransparency = 0
                                                    xswitch.whichChoice = 0;
  
                    } else {
                                      main_P.shadowTransparency = 1
  
                                                            }                                  
            }
            "
    }
    ] } 
    
  


(C) A. Eliëns 21/5/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.