Web3D/VRML
[] readme course preface 1 2 3 4 5 6 7 reference examples resources

talk show tell print

vr-metadata-proto.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  
  
  
  
  
  
  
  PROTO MetaData [
     exposedField MFString instructions [
                  " This is an externproto definition file."
                  " To include, add the following in your vrml file:"
                  "    (click text to print to vrml console,"
                  "     for easy cut and paste)"
          ]
     exposedField MFString name []
     exposedField MFString description []
     exposedField MFString interface []
  ]
  {
  
     Transform {
        translation -3.75 4.5 0
        children [
  
           Transform {
                   translation 0 0 0
                   children [
                      Shape {
                         geometry Text {
                            fontStyle DEF FS FontStyle {
                               family [ "SANS" ]
                               size .25
                            }
                                 string IS instructions
                         }
                      }
                   ]
           }
           Transform {
                   translation 0 -1.5 0
                   children [
                 Shape {
                         geometry Text {
                            fontStyle FontStyle {
                               family [ "SANS" ]
                          style  "BOLD"
                               size .25
                       }
                            string IS name
                         }
                 }
                   ]
           }
           Transform {
                   translation 0 -2 0
                   children [
                 Shape {
                         geometry Text {
                                 fontStyle USE FS
                            string IS description
                         }
                 }
                   ]
           }
           Transform {
                   translation 0 -3.5 0
                   children [
                 DEF TS TouchSensor {}
                      Shape {
                         geometry DEF TXT Text {
                            fontStyle FontStyle {
                               family [ "TYPEWRITER" ]
                               size .3
                            }
                                 string IS interface
                         }
                      }
  
                   ]
           }
  
           DEF S Script {
                   eventIn SFBool print_isActive
                   field   SFNode txt USE TXT
                   directOutput TRUE
                   url["javascript:
                      function print_isActive(itIs) {
                         if(itIs) {
                            print(' ');
                            for(var i = 0; i < txt.string.length; i++) { print(txt.string[i]); }
                         }
                      }
                      "]
           }
        ]
     }
  
     ROUTE TS.isActive TO S.print_isActive
  }
  
  MetaData {
     name ["MetaData"]
     description [
        "descriptive info display for protos."
        "typically, protos present the user with an empty screen;"
        "by using a MetaData proto, you can provide helpful info"
        "and a printable interface."
     ]
     interface [
        "EXTERNPROTO MetaData ["
             "   exposedField MFString instructions "
        "   exposedField MFString name "
        "   exposedField MFString description "
        "   exposedField MFString interface "
        "] \"@vr-vr-metadata-proto.wrl\""
     ]
  }
  
  


[] readme course preface 1 2 3 4 5 6 7 reference examples resources
eliens@cs.vu.nl

draft version 0.3 (17/9/2001)