home *** CD-ROM | disk | FTP | other *** search
/ Late Night VRML 2.0 with Java CD-ROM / code.zip / Ch10 / 5041108.wrl < prev    next >
Text File  |  1996-12-17  |  1KB  |  53 lines

  1. #VRML V2.0 utf8
  2. #Example 11.8 - MovieTexture - stopTime from script node
  3. NavigationInfo {
  4.   type    "EXAMINE"
  5. }
  6. Viewpoint {
  7.   position  -1.995 1.668 4.105
  8.   orientation       -0.639 -0.754 -0.153  0.617
  9.   fieldOfView       0.785
  10. }
  11. Group {
  12.   children  [
  13.     DEF Start_Movie TouchSensor {
  14.     }
  15.     Shape {
  16.       appearance    Appearance {
  17.         material        Material {
  18.           ambientIntensity      0.25
  19.           diffuseColor  0.8 0.8 0.8
  20.           shininess     0.2
  21.         }
  22.         texture      DEF Test_Movie MovieTexture {
  23.           url       "pyro.mps"
  24.           loop      TRUE
  25.           startTime 0
  26.           stopTime  1
  27.         }
  28.       }
  29.       geometry      Box {
  30.       }
  31.     }
  32.     Sound {
  33.       source      USE Test_Movie
  34.       minFront    8
  35.       maxFront    20
  36.       minBack     5
  37.       maxBack     15
  38.     }
  39.     DEF Stop_It Script {      # Stop Movie after 6 seconds
  40.       eventOut     SFTime      stopTime_changed
  41.       eventIn      SFTime      set_startTime
  42.       url    "javascript:
  43.       function set_startTime(value) {
  44.         stopTime_changed = value + 6;
  45.       }"
  46.     }
  47.   ]
  48. }
  49. ROUTE Start_Movie.touchTime TO Stop_It.set_startTime
  50. ROUTE Start_Movie.touchTime TO Test_Movie.set_startTime
  51. ROUTE Stop_It.stopTime_changed TO Test_Movie.set_stopTime
  52. #EOF
  53.