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

soccer.vr

soccer.vr (wrl /pl ) [ flux / bitmanagement / cortona / octaga ]

soccer

extern


  
  ##extern @vr/extern/proto/avatar/sport.wrl
  ##extern @vr/extern/proto/avatar/cutie.wrl
  
  

scene


  
  PROTO MyViewPoint [ exposedField SFVec3f position 0 0 0
                            exposedField SFRotation orientation 0 1 0 0
                            exposedField   SFBool set_bind  TRUE]
          { Viewpoint { position IS position
                            orientation IS orientation
                            set_bind  is set_bind } }
  
  DEF Viewpoint MyViewPoint { position 35 1.75 0 orientation 0 1 0 -1.5708  set_bind TRUE}
  # normal viewpoint
  
  #DEF Viewpoint MyViewPoint { position 0 80 0 orientation 1 0 0 -1.5708  set_bind FALSE}
  #viewpoint from top
  
  

field


  
  Transform {
  
  rotation 0 1 0 1.57 
  children [
  
  Transform {        
          translation 0 0 0
          children [
          Shape {
                  appearance Appearance {
                  texture ImageTexture { url "@archive/soccer/field1.gif" }
                  textureTransform TextureTransform {scale 1 1}
                                  } 
                   geometry Box {size 100 .2 64}
                  }
                  ]
          } 
  
  

proto gate


  
  PROTO Gate [field MFString GateName [ ]
               exposedField SFVec3f translation 0 0 0
               exposedField SFRotation rotation 0 1 0 0]
  {
  Transform { translation IS translation
                  rotation IS rotation
          children [
  
          Transform {        
          translation 0 2.43 0
          children [
          Shape {
                  appearance Appearance {material DEF ColorofGate Material {diffuseColor 0.2 0.2 0.2
                                                                          emissiveColor .5 .5 .5}}
                   geometry Box {size 7.4 .2 .2}
                  } ] }# gate top
  
          Transform {        
          translation -3.6 1.22 0
          children [
          Shape {
                  appearance Appearance {material USE ColorofGate}
                   geometry Box {size .2 2.44 .2}
                  } ] } # gate left
  
          Transform {        
          translation 3.6 1.22 0
          children [
          Shape {
                  appearance Appearance {material USE ColorofGate}
                   geometry Box {size .2 2.44 .2}
                  } ] } # gate right
  
          Transform {
          translation -3.6 1.22 -0.5
          children [
          Shape { appearance Appearance {
             material Material {diffuseColor 0.6 0.6 0.6
                                          emissiveColor 1 1 1
                                          transparency .7}
                   }
          geometry Box {size .05 2.44 1}
          }]}#  left back of gate
  
          Transform {
          translation 3.6 1.22 -0.5
          children [
          Shape { appearance Appearance {
             material Material {diffuseColor 0.6 0.6 0.6
                                          emissiveColor 1 1 1
                                          transparency .7}
                   }
          geometry Box {size .05 2.44 1}
          }]}#  right back of gate
  
          Transform {
          translation 0 1.22 -1
          children [
          Shape { appearance Appearance {
             material Material {diffuseColor 0.6 0.6 0.6
                                          emissiveColor 1 1 1
                                          transparency .7}
                   }
          geometry Box {size 7.4 2.44 .05}
          }]}#  middle back of gate
  
  ] } } # end of  proto Gate
  
  

gate


  
  Transform {children [ DEF leftGate Gate { GateName [ leftgate]  translation -49 0 0 rotation 0 1 0 1.5708} ] }
  
  Transform {children [ DEF rightGate Gate { GateName [ rightgate]  translation 49 0 0 rotation 0 1 0 -1.5708} ] }
  
  

proto ball


  
  PROTO Ball [field MFString BallName [ ]
               exposedField SFVec3f translation 0 0 0
               exposedField SFRotation rotation 0 1 0 0]
  {
  Transform { translation IS translation
                  rotation IS rotation
          children [
  
          Transform {        
          translation 0 0 0
        children [
          Shape {
                  appearance Appearance {material Material {diffuseColor .9 .9 .9 
                                                                          emissiveColor .9 .9 .9}
                                                  texture ImageTexture { url "@archive/soccer/ball1.gif" }
                  textureTransform TextureTransform {scale 2 2}
  }
                   geometry Sphere {radius .35}
                  } ] }# end of transform
  ] } } # end of proto ball
  
  

ball


  
  Transform {
  translation 40 0 0
  children [
  DEF ball Ball { BallName [ mainball]  translation 0 .35 0 rotation 0 1 0 0}
  Transform {
  translation -1 3.50 0
  rotation 0 1 0 1.56
  scale 2 2 2
  children [
  DEF footballer avatar-cutie { dialog -1 }
  ]
  }
  ] }
  
  

proto flagpost


  
  PROTO FlagPost [
               exposedField SFVec3f translation 0 0 0
               exposedField SFRotation rotation 0 1 0 0]
  {
  Transform { translation IS translation
                  rotation IS rotation
          children [
  
          Transform {        
          translation 0 1 0
          children [
          Shape {
                  appearance Appearance {material Material {diffuseColor 0.9 0.9 0.2
                                                                          emissiveColor .9 .9 .2}}
                   geometry Cylinder {height 2 radius .1}
                  } ] }# end of pole
  
          Transform {        
          translation 0.25 1.75 0
          children [
          Shape {
                  appearance Appearance {material Material {diffuseColor 1 0 0
                                                                          emissiveColor 1 0 0}}
                   geometry Box {size .5  .5  .05}
                  } ] }# end of flag
  ]}} # end of proto flagpost
   
  

flagpost


  
  Transform {children [ DEF lefttopflagpost FlagPost { translation -49 0 -31 rotation 0 1 0 0} ] }
  Transform {children [ DEF leftbottomflagpost FlagPost { translation 49 0 -31 rotation 0 1 0 0} ] }
  Transform {children [ DEF righttopflagpost FlagPost { translation -49 0 31 rotation 0 1 0 0} ] }
  Transform {children [ DEF rightbottomflagpost FlagPost { translation 49 0 31 rotation 0 1 0 0} ] }
  
  

proto goalkeeper


  
  PROTO GoalKeeper [
               exposedField SFVec3f translation 0 0 0
               exposedField SFRotation rotation 0 1 0 0
               exposedField SFInt32 gesture 0 
  ]{
  Transform { translation IS translation
                  rotation IS rotation
          children [ avatar-sport {
  avatarSize[ 0.25 1.7500]
  isAvatar TRUE
  ##gestureNames ["","Likes jim","Agrees jim","Smiles jim","Frowns jim","Disagrees jim","No likes jim","Good by lil","Superzen lil","Rire jim"]
   rotation 0 1 0 0
  whichChoice 0
  gesture IS gesture
  isOver FALSE
  touchTime 0
  ##position  0 0 0
  ##isPilot FALSE
  ##nickname "goalKeeper"
  
  }
  ]
  }} # end of proto GoalKeeper
  
  

goalkeeper


  
  Transform { children [ 
  DEF goalkeeper GoalKeeper {
  translation 48 1.8 0 rotation 0 1 0 -1.5708 } ]
  }
  
  ]}
  
                  
  


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