u5.wrl

 garaz2.wrl  u5.wrl  fence.wrl  tree.wrl  table.wrl  tw.wrl  stavba.wrl  tank.wrl  sibenice.wrl  hud.wrl  cafe.wrl 
Zpět Zpět
   1 : #VRML V2.0 utf8
   2 : 
   3 : WorldInfo {
   4 :  info ["Author: Jakub Zemlicka, Martin Petricek, Tomas Kazmar"]
   5 :  title "Uloha 5"
   6 : }
   7 : 
   8 : NavigationInfo {
   9 :  headlight TRUE
  10 : }
  11 : 
  12 : Background {
  13 :  skyColor [.2 .2 .4]
  14 :  groundColor [.2 .6 .2]
  15 : }
  16 : 
  17 : DirectionalLight {
  18 :  intensity .5
  19 :  ambientIntensity .5
  20 :  direction -20 -8 -2
  21 : }
  22 : 
  23 : Viewpoint {
  24 :  description "Daleko 1"
  25 :  position 27 40 70
  26 :  orientation 0.717 -0.69 -0.1 -0.681
  27 :  jump FALSE
  28 : }
  29 : 
  30 : Viewpoint {
  31 :  description "Daleko 2"
  32 :  position -20 40 70
  33 :  orientation -0.717 -0.69 -0.1 0.681
  34 :  jump FALSE
  35 : }
  36 : 
  37 : Viewpoint {
  38 :  description "Stredni 1"
  39 :  position 25 1.6 21
  40 :  orientation 0 1 0 1.1
  41 :  jump FALSE
  42 : }
  43 : 
  44 : Viewpoint {
  45 :  description "Stredni 2"
  46 :  position 23 1.6 23
  47 :  orientation 0 1 0 0.6
  48 :  jump FALSE
  49 : }
  50 : 
  51 : Viewpoint {
  52 :  description "Blizko 1"
  53 :  position -11.37 1.6 17.41
  54 :  orientation -0.6 0.8 0.05 0.2
  55 :  jump FALSE
  56 : }
  57 : 
  58 : Viewpoint {
  59 :  description "Blizko 2"
  60 :  position -12 1.6 17.5
  61 :  orientation -0.93 0.35 0 0.18
  62 :  jump FALSE
  63 : }
  64 : 
  65 : EXTERNPROTO Tank [
  66 :  exposedField SFVec3f pos
  67 :  exposedField SFRotation rot
  68 :  exposedField SFInt32 lod
  69 :  exposedField SFColor wheelColor
  70 :  exposedField SFColor wheelDarkColor
  71 :  exposedField SFNode tex
  72 :  field MFFloat lodRanges
  73 :  exposedField SFColor light
  74 :  exposedField SFFloat lightIntensity
  75 :  eventIn SFBool lightOn
  76 :  exposedField SFTime startRotation
  77 :  exposedField SFTime stopRotation
  78 :  eventIn SFFloat rotSpeed
  79 :  field SFString name
  80 :  eventOut SFString get_name
  81 :  eventOut SFBool nearby
  82 : ] "tank.wrl#Tank"
  83 : 
  84 : EXTERNPROTO TankTex [
  85 :  field MFString tex
  86 : ] "tank.wrl#TankTex"
  87 : PROTO Pink[]{
  88 :  Appearance {
  89 :   material Material {
  90 :    diffuseColor .9 .5 .9
  91 :    ambientIntensity .6
  92 :    specularColor .3 .1 .3
  93 :   }
  94 :  }
  95 : }
  96 : 
  97 : EXTERNPROTO	Kafemlynek [ 
  98 :  exposedField SFInt32 lod
  99 :  exposedField MFString	texture
 100 :  exposedField SFColor Color
 101 :  field MFFloat lodRanges
 102 :  field SFVec3f rot
 103 :  field SFColor lightcolor
 104 :  eventIn SFBool lightOn
 105 :  exposedField SFTime startRotation
 106 :  exposedField SFTime stopRotation
 107 :  eventIn SFFloat rotSpeed
 108 :  eventOut SFString	get_name
 109 :  field SFString name 
 110 :  eventOut SFBool nearby  
 111 : ] "cafe.wrl#Kafemlynek"
 112 : 
 113 : 
 114 : EXTERNPROTO TW [
 115 :  exposedField SFNode plastic
 116 :  exposedField SFNode steel
 117 :  exposedField SFColor light
 118 :  eventIn SFBool lightOn
 119 :  exposedField SFTime startRotation
 120 :  exposedField SFTime stopRotation
 121 :  eventIn SFFloat rotSpeed
 122 :  eventOut SFString	get_name
 123 :  field SFString name
 124 :  eventOut SFBool nearby
 125 : ] "tw.wrl#TW"
 126 : 
 127 : Transform {
 128 :  translation 7 0 8
 129 :  children [
 130 :   Viewpoint {
 131 :    description "Stul 1"
 132 :    position -2.2 1.6 -2.5
 133 :    orientation 0.717 -0.69 -0.1 -0.681
 134 :    jump FALSE
 135 :   }
 136 :   Transform {
 137 :    scale .08 .08 .08
 138 :    translation -3.35 .77 -4.3
 139 :    children DEF T1 Tank { name "Zluty tank" rot 0 1 0 1.54 lightIntensity 10 light 1 0 0 lod 1 pos 0 1.3 0 tex TankTex{ tex "tank1.png"} wheelColor .6 .4 0 wheelDarkColor .3 .3 0}
 140 :   }
 141 :   Transform { translation -3.2 .77 -3.8 children DEF KAFE1 Kafemlynek {lod 1 texture "drevo.jpg" Color 1 1 1 lightcolor 0 0 1 name "Dreveny kafemlynek"} rotation 0 1 0 .5}
 142 :   Transform { translation -2.7 .77 -3.7 children DEF TW1 TW {
 143 :     light 0 1 0
 144 : 	name "Cerny psaci stroj"
 145 :     plastic Appearance {
 146 :      texture ImageTexture { url ["marble02_sm.png"] }
 147 :      material Material {
 148 :       diffuseColor .47 .53 .6
 149 :       specularColor .32 .4 .4
 150 :       emissiveColor .07 .08 .09
 151 :       ambientIntensity .0667
 152 :       shininess .54
 153 :      }
 154 :     }
 155 :     steel Appearance {
 156 :      texture ImageTexture { url ["metal.png"] }
 157 :      material Material {
 158 :       diffuseColor .61 .61 .61
 159 :       specularColor .39 .39 .39
 160 :       ambientIntensity .25
 161 :       shininess .11
 162 :      }
 163 :     }
 164 :    }
 165 :    rotation 0 1 0 .1}
 166 :   Transform { translation -3 0 -4.2 children DEF Table Inline { url "table.wrl#Table" } }
 167 :  ]
 168 : }
 169 : Transform {
 170 :  translation 5 0 0
 171 :  children [
 172 :   Transform { translation 0 0 0 children Inline { url "garaz2.wrl" } }
 173 :   DEF T2 Tank { name "Ruzovy tank" lightIntensity 1.5 light 0 1 0 lod 1 pos -18 1.3 10 rot 0 1 0 4   tex Pink{} wheelColor .8 .4 .8 wheelDarkColor .6 .5 .6}
 174 :   DEF T3 Tank { name "Zeleny tank" lightIntensity 10 light 1 0 1 lod 1 pos 12 1.3 13 rot 0 1 0 2.8 tex TankTex{} wheelColor 0 .4 0 wheelDarkColor 0 .1 0}
 175 :  ]
 176 : }
 177 : 
 178 : Transform {
 179 :  rotation 0 1 0 1.4
 180 :  translation 23 0 18
 181 :  children Group {
 182 :   children [
 183 :    Transform { translation -3.2 .77 -3.8 children DEF KAFE2 Kafemlynek {name "Mahagonovy kafemlynek" lod 1 texture "mahagon_md.jpg" lightcolor 0 1 0} rotation 0 1 0 .5}
 184 :    Transform { translation -2.7 .77 -3.7 children DEF TW2 TW {
 185 :      light 1 0 0 
 186 : 	 name "Dreveny psaci stroj"
 187 :      plastic Appearance {
 188 :       texture ImageTexture { url ["wood25_sm.png"] }
 189 :       material Material {}
 190 :      }
 191 :      steel Appearance {
 192 :       texture ImageTexture {
 193 :        url ["gold2_sm.png"]
 194 :       }
 195 :       material Material {}
 196 :      }
 197 :     }			
 198 :     rotation 0 1 0 .1}
 199 :    Transform { translation -3 0 -4.2 children USE Table }
 200 :   ]
 201 :  }
 202 : }
 203 : 
 204 : Transform {
 205 :  center -3 0 -4.2
 206 :  translation -9 0 19
 207 :  children Group {
 208 :   children [
 209 :    Transform { translation -3.2 .77 -3.8 children DEF KAFE3 Kafemlynek { name "Kovovy kafemlynek" lod 1 texture "cafe8.png" Color 1 1 1 lightcolor 1 0 0} rotation 0 1 0 .5}
 210 :    Transform { translation -2.7 .77 -3.7 children DEF TW3 TW {name "Klasicky psaci stroj" light 0 0 1} rotation 0 1 0 .1}
 211 :    Transform { translation -3 0 -4.2 children USE Table }
 212 :   ]
 213 :  }
 214 : }
 215 : 
 216 : EXTERNPROTO Tree [ exposedField SFVec3f pos] "tree.wrl#Tree"
 217 : Transform { translation  12 0   14 children Tree{} rotation 0 1 0 1 scale 1 1 1.3 }
 218 : Transform { translation  10 0   15 children Tree{} rotation 0 1 0 2 scale 1 1.3 1.1 }
 219 : Transform { translation   8 0   17 children Tree{} rotation 0 1 0 3 scale 1.1 1.1 1.4 }
 220 : Transform { translation   6 0   16 children Tree{} rotation 0 1 0 4 scale 1.5 1.2 1 }
 221 : Transform { translation   4 0   18 children Tree{} rotation 0 1 0 5 scale 1.2 1.4 1 }
 222 : 
 223 : EXTERNPROTO Stavba [] "stavba.wrl#Stavba"
 224 : Transform { translation -14 0   -7 children Stavba{} rotation 0 1 0 1.57 }
 225 : 
 226 : EXTERNPROTO Sibenice [] "sibenice.wrl#Sibenice"
 227 : Transform { translation  12 0    9 children Sibenice{} rotation 0 1 0 1.57 }
 228 : 
 229 : 
 230 : EXTERNPROTO HudSystem [
 231 :  eventOut SFTime button1touchOn
 232 :  eventOut SFTime button1touchOff
 233 :  eventOut SFBool button2touch
 234 :  eventIn SFTime button2change
 235 :  eventOut SFFloat slider
 236 :  exposedField SFVec3f pos
 237 :  exposedField SFRotation rot
 238 : ] "hud.wrl#HudSystem"
 239 : 
 240 : DEF H HudSystem {}
 241 : ROUTE H.button1touchOn TO T1.startRotation
 242 : ROUTE H.button1touchOff TO T1.stopRotation
 243 : ROUTE H.button2touch TO T1.lightOn
 244 : ROUTE H.slider TO T1.rotSpeed
 245 : ROUTE H.button1touchOn TO T2.startRotation
 246 : ROUTE H.button1touchOff TO T2.stopRotation
 247 : ROUTE H.button2touch TO T2.lightOn
 248 : ROUTE H.slider TO T2.rotSpeed
 249 : ROUTE H.button1touchOn TO T3.startRotation
 250 : ROUTE H.button1touchOff TO T3.stopRotation
 251 : ROUTE H.button2touch TO T3.lightOn
 252 : ROUTE H.slider TO T3.rotSpeed
 253 : 
 254 : ROUTE H.button1touchOn TO TW1.startRotation
 255 : ROUTE H.button1touchOff TO TW1.stopRotation
 256 : ROUTE H.button2touch TO TW1.lightOn
 257 : ROUTE H.slider TO TW1.rotSpeed
 258 : ROUTE H.button1touchOn TO TW2.startRotation
 259 : ROUTE H.button1touchOff TO TW2.stopRotation
 260 : ROUTE H.button2touch TO TW2.lightOn
 261 : ROUTE H.slider TO TW2.rotSpeed
 262 : ROUTE H.button1touchOn TO TW3.startRotation
 263 : ROUTE H.button1touchOff TO TW3.stopRotation
 264 : ROUTE H.button2touch TO TW3.lightOn
 265 : ROUTE H.slider TO TW3.rotSpeed
 266 : 
 267 : ROUTE H.button1touchOn TO KAFE1.startRotation
 268 : ROUTE H.button1touchOff TO KAFE1.stopRotation
 269 : ROUTE H.button2touch TO KAFE1.lightOn
 270 : ROUTE H.slider TO KAFE1.rotSpeed
 271 : ROUTE H.button1touchOn TO KAFE2.startRotation
 272 : ROUTE H.button1touchOff TO KAFE2.stopRotation
 273 : ROUTE H.button2touch TO KAFE2.lightOn
 274 : ROUTE H.slider TO KAFE2.rotSpeed
 275 : ROUTE H.button1touchOn TO KAFE3.startRotation
 276 : ROUTE H.button1touchOff TO KAFE3.stopRotation
 277 : ROUTE H.button2touch TO KAFE3.lightOn
 278 : ROUTE H.slider TO KAFE3.rotSpeed
 279 : 
 280 : 
 281 : DEF NAMES Script {
 282 :  eventIn SFBool name
 283 :  field MFNode obj [USE T1 , USE T2, USE T3, USE TW1, USE TW2, USE TW3, USE KAFE1, USE KAFE2, USE KAFE3]
 284 :  eventOut SFString jmeno
 285 :  url "javascript:
 286 :  function name() {
 287 :   jmeno='';
 288 :   any=0;
 289 :   for(i=0;i<obj.length;i++) {
 290 :    if (obj[i].nearby) {
 291 :     jmeno=jmeno+obj[i].name+&#039;\n';
 292 :     any++;
 293 :    }
 294 :   }
 295 :   if (any==0) jmeno=&#039;You are in a nice garden.\nNo machines nearby.';
 296 :   else jmeno=&#039;Nearby machine count: '+any+'\n'+jmeno;
 297 :  }
 298 : 
 299 :  "
 300 : }
 301 : 
 302 : ROUTE T1.nearby TO NAMES.name
 303 : ROUTE T2.nearby TO NAMES.name
 304 : ROUTE T3.nearby TO NAMES.name
 305 : ROUTE TW1.nearby TO NAMES.name
 306 : ROUTE TW2.nearby TO NAMES.name
 307 : ROUTE TW3.nearby TO NAMES.name
 308 : ROUTE KAFE1.nearby TO NAMES.name
 309 : ROUTE KAFE2.nearby TO NAMES.name
 310 : ROUTE KAFE3.nearby TO NAMES.name