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

template-humanoid-extended.vr

template-humanoid-extended.vr (wrl ) [ flux / bitmanagement / cortona / octaga ]


  
  
  #@extern @vr-extern-proto-dlp-bulb.wrl
  
  PROTO humanoid-@name [
  
  <template type=humanoid-exports-extended/>
  
   exposedField SFInt32 visible 0
   exposedField SFInt32 persona 0
   exposedField SFInt32 dialog 0
  
   exposedField SFBool isPilot FALSE
  
   exposedField MFFloat avatarSize [.25 0 .05]
   exposedField SFFloat avatarHeight 1.75
   exposedField SFBool isAvatar TRUE
  
   eventIn SFInt32 gesture
  
   exposedField SFTime gesture1 0
   exposedField SFTime gesture2 0
   exposedField SFTime gesture3 0
   exposedField SFTime gesture4 0
   exposedField SFTime gesture5 0
   exposedField SFTime gesture6 0
   exposedField SFTime gesture7 0
   exposedField SFTime gesture8 0
  
  eventIn SFVec3f set_position
  exposedField SFRotation rotation 0 1 0 0
  
  exposedField SFInt32 whichChoice 0
  exposedField SFBool isOver FALSE
  exposedField SFTime touchTime 0
  
  exposedField SFVec3f translation 0 0 0
  
  exposedField  SFVec3f     center               0 0 0
  ##exposedField  MFNode      humanoidBody         [ ]
  exposedField  MFString    info                 [ ]
  exposedField  MFNode      joints               [ ]
  exposedField  SFString    name                 "@name"
  ##exposedField  SFRotation  rotation             0 0 1 0
  exposedField  SFVec3f     scale                1 1 1
  exposedField  SFRotation  scaleOrientation     0 0 1 0
  exposedField  MFNode      segments             [ ]
  exposedField  MFNode      sites                [ ]
  ##exposedField  SFVec3f     translation          0 0 0
  ##exposedField  SFString    version              "1.1"
  ##exposedField  MFNode      viewpoints           [ ]
  
  eventIn MFString message 
  exposedField MFString string [] 
  exposedField SFVec3f bulb_translation 0 0 0 
  exposedField SFRotation bulb_rotation 0 0 1 0
  exposedField SFVec3f bulb_scale 1 1 1
  exposedField SFInt32 type 1
  exposedField SFColor color 0.9 0.9 0.9
  exposedField SFColor text 0.1 0.1 0.1
  exposedField SFFloat transparency 1
  exposedField SFVec3f text_scale 1 1 1 
  exposedField SFVec3f text_translation 0 0 0 
  exposedField SFRotation text_rotation 0 0 1 0
  exposedField MFString background []
  eventOut MFString message_changed
  ]{
  Switch {
  whichChoice IS visible
  choice [
  Transform {
  translation IS translation
  children [
  Switch {
  whichChoice IS dialog
  choice [
  DEF bulb-root Transform {
  scale 0.3 0.3 0.3
  children [ 
  DEF bulb dlp-bulb { 
  message IS message
  string IS string
  translation IS bulb_translation
  rotation IS bulb_rotation
  scale IS bulb_scale
  type IS type
  color IS color
  text IS text
  transparency IS transparency
  text_scale IS text_scale
  text_translation IS text_translation
  text_rotation IS text_rotation
  background IS background
  message_changed IS message_changed
  }
  ]}
  ] } ## dialog
  Switch {
  whichChoice IS persona
  choice [
  Transform {
  translation 0 -1 0
  scale 0.8 0.8 0.8
  children [
  DEF humanoid Humanoid-@name {
  <template type=humanoid-is/>
  center IS center
  info IS info
  joints IS joints
  name IS name
  rotation IS rotation
  scale IS scale
  scaleOrientation IS scaleOrientation 
  segments IS segments
  sites IS sites           
  translation IS translation
  } ] }
  ] } ## persona
  ] }
  ] } ## visible
  Script {
  directOutput TRUE
  mustEvaluate TRUE
  eventIn SFInt32 gesture IS gesture
  eventIn SFVec3f set_position IS set_position 
  field SFNode bulb USE bulb-root
  field SFNode avatar USE humanoid
  url "javascript:
  function set_position(value) {
  avatar.translation = value;
  bulb.translation = value;
  }
  function gesture(value,time) {
  if (value==0) { // nothing
  } else if (value == 1) { avatar.gesture1 = time;
  } else if (value == 2) { avatar.gesture2 = time;
  } else if (value == 3) { avatar.gesture3 = time;
  } else if (value == 4) { avatar.gesture4 = time;
  } else if (value == 5) { avatar.gesture5 = time;
  } else if (value == 6) { avatar.gesture6 = time;
  } else if (value == 7) { avatar.gesture7 = time;
  } else if (value == 8) { avatar.gesture8 = time;
  }
  }
  "
  }
  
  }
  

[] 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 _

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