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

proto-slide-element-image.vr

proto-slide-element-image.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  

image

Web3D/VR

proto


  
  PROTO ImageElement [
      exposedField SFString elementType "IMAGEELEMENT"
  
      exposedField SFInt32  startLevel -1
      exposedField SFInt32  endLevel   -1
  
      exposedField SFFloat  width       1
      exposedField SFFloat  height      1
      exposedField SFVec3f  size        0.5 0.5 0.01
      exposedField SFBool   linebreak   FALSE
      
      exposedField SFBool     absolute    FALSE
  
      exposedField MFNode children      []  
      exposedField MFString url []
  
      exposedField SFVec3f    location       0 0 0
      exposedField SFRotation rotation    0 1 0 0
      exposedField SFVec3f    scale          1 1 1 ## AE  
  
      exposedField SFVec3f  position    0 0 0 
      exposedField SFColor  color       1 1 1
      exposedField SFColor  bgColor        0 0 1
      exposedField SFFloat  bgTransparency 1
  
      exposedField MFString justify     [ "BEGIN" ]
      exposedField MFString family      [ "SERIF" ]
      exposedField SFString style       "PLAIN"
  
      exposedField SFString href        ""
      exposedField MFString parameters  []
  ] {
  

body


      
      DEF TRANSFORM Transform {
          translation IS position
                  children [
                  Transform {
                       translation IS location
                      scale IS scale
                      rotation IS rotation
                      children [
                      Shape {
                          appearance Appearance {
                              material Material {
                                  diffuseColor 1 1 1
                              }
                              texture ImageTexture {
                                  url IS url
                              }
                          }
                          geometry DEF BOX Box {
                              size IS size
                          }
                      }
                  ] } 
                  ]
      }
  

script


      DEF SCRIPT Script {
          mustEvaluate TRUE
          directOutput TRUE
          field    SFNode   transform      USE TRANSFORM
          field    SFNode   me             USE SCRIPT
          field    SFNode   box            USE BOX
  
          field SFColor    bgColor        IS bgColor     
          field SFFloat    bgTransparency IS bgTransparency
  
          field SFString   href IS href                    
          field MFString   parameters IS parameters
          eventIn SFTime touched
  
          url "vrmlscript:
              function initialize() {
  
                  if(href != '') {
                   var touch = Browser.createVrmlFromString(' TouchSensor{} ');
                   transform.addChildren = touch;
                   Browser.addRoute(touch[0],'touchTime',me,'touched');
                  }
              }
              function touched(v,t) {
                  Browser.loadURLrel(href,parameter);
                  // Change, this for absolute URLs
                  // Browser.loadURL(href,parameter);
  
              }
          "
      }
  }
  
  


(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.