home *** CD-ROM | disk | FTP | other *** search
/ Internet 1996 World Exposition / park.org.s3.amazonaws.com.7z / park.org.s3.amazonaws.com / Japan / Sony / 3DWorld / ZEIT / VRML / main.tcl < prev    next >
Text File  |  2017-09-21  |  1KB  |  50 lines

  1. set B 0
  2. set R 0
  3. set Person 0
  4.  
  5. set cnt 0
  6. set endflg 0
  7.  
  8. proc mot {obj ev ud} {
  9.     global    B R Person cnt endflg
  10.     global    vsContinue vsCSLocal vsRelative vsCSWorld vsAbsolute
  11.  
  12.     if {$cnt < 36} {
  13.     vsRotateAngle $B 0 -10 0 $vsCSLocal $vsRelative
  14.     vsRotateAngle $R 0 -10 0 $vsCSLocal $vsRelative
  15.     vsTranslate $Person 0 0 -4 $vsCSWorld $vsRelative
  16.     } else {
  17.     vsRotateAngle $B 0 -1 0 $vsCSLocal $vsRelative
  18.     vsRotateAngle $R 0 -1 0 $vsCSLocal $vsRelative
  19.     vsGetObjWRT  $Person x y z x1 y1 z1 x2 y2 z2 x3 y3 z3
  20.     if {$z > 5.0} {
  21.         vsTranslate $Person 0 0 -1 $vsCSWorld $vsRelative
  22.     } else {
  23.         if {$endflg == 0} {
  24.         vsWwwOpenUrl "e-room.wrl"
  25.         }
  26.     }
  27.     }
  28.  
  29.     incr cnt
  30.     return $vsContinue
  31. }
  32.  
  33. proc init {obj ev ud} {
  34.     global    B R Person
  35.     global    vsCSWorld vsRelative vsTclScript vsPeriodicTask
  36.  
  37.     set B [vsGetObjByName $obj "B" -r]
  38.     set R [vsGetObjByName $obj "R" -r]
  39.  
  40.     vsTranslate $B 0 -10 0 $vsCSWorld $vsRelative
  41.     vsTranslate $R 0 -10 0 $vsCSWorld $vsRelative
  42.  
  43.     vsRotateAngle $B 30 0 0 $vsCSWorld $vsRelative
  44.     vsRotateAngle $R 30 0 0 $vsCSWorld $vsRelative
  45.  
  46.     set Person [vsGetPerson]
  47.  
  48.     vsAddTimeOutHandler $obj 500 $vsTclScript "" mot "" $vsPeriodicTask
  49. }
  50.