home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format 20 / af020.adf / Script4D / eyeeye.prog < prev    next >
Text File  |  1980-02-23  |  2KB  |  102 lines

  1.     FRAMES  50
  2.     
  3.         /* define a 7-step smooth motion for 0 thru 90 degrees */
  4.     SMOOTHER blinking 0 90 7
  5.         /* bounce up/down motion in 11 steps */
  6.     SMOOTHER bouncing 0 -2000 11
  7.     
  8.     TO init
  9.         EXECUTE
  10.         'LOAD TAKE "EYE.TAKE" '
  11.         'COORDINATES 0'
  12.         SUSPEND init 32000   /* init suspended for 32000 frames! */
  13.         END
  14.     END
  15.     
  16.     TO getscene             /* gets base scene for each frame */
  17.         EXECUTE
  18.             'TAKE CURRENT FRAME %d' (i) frame
  19.             'ERASE ALL'
  20.             '(0,0,0)'
  21.             'LOAD SCENE "Eyeeye.scene"'
  22.         END
  23.     END
  24.     
  25.     TO blink            /* how to make the eye blink */
  26.         SETUP
  27.         blinkstep = 2        /* 2 because 1st angle would be 0 */
  28.         closingtime = 0
  29.         END
  30.         EXECUTE
  31.                     /* select next angle for smooth motion */
  32.         blinkangle @= blinking blinkstep /* alternative to SMOOTH */
  33.             'DESELECT ALL'        /* output script commands to.. */
  34.             'SELECT NAMED "Eye+Lid"'    /* ..rotate eyelid */
  35.             'WINDOW EAST'
  36.             'ROTATE CLOCKWISE %d' (i) blinkangle
  37.             IF blinkstep = 7    /* handle eye-closed time */
  38.                 FREEZE closingtime
  39.             ENDIF
  40.             blinkstep += 1        /* ready for next frame */
  41.             IF blinkstep > 12
  42.                 SUSPEND blink 32000
  43.             ENDIF
  44.         END
  45.     END
  46.     
  47.     TO bounce            /* bouncing up & down */
  48.         SETUP  bouncestep = 1  END
  49.         EXECUTE
  50.             bouncelevel @= bouncing bouncestep
  51.             'SELECT ALL'
  52.             'GRABBER ON'
  53.             '[0,0,%d]' (i) bouncelevel
  54.             'GRABBER OFF'
  55.             IF bouncestep = 6
  56.                 bouncestep += 11    /* going up! */
  57.             ELSE
  58.                 bouncestep += 1
  59.             ENDIF
  60.             IF bouncestep = 21
  61.                 bouncestep = 1        /* going down */
  62.             ENDIF
  63.         END
  64.     END
  65.  
  66.     TO savescene            /* saves scene & makes key frame */
  67.         EXECUTE
  68.             'TAKE KEY YES'
  69.         'TAKE SAVE KEY FRAME SCENE'
  70.         END
  71.     END
  72.     
  73.     TO render            /* final script command */
  74.         EXECUTE
  75.         'TAKE PREVIEW'        /* OR  'TAKE RENDER ALL' */
  76.         END
  77.     END
  78.     
  79.     
  80.     AT 1                /* before anything else.. */
  81.         START init            /* start once-off init */
  82.         START getscene        /* start scene load.. */
  83.         START savescene        /* ..and save procedures */
  84.         START bounce        /* bouncing all the time */
  85.     END
  86.     
  87.     AT 50                /* when all scenes generated.. */
  88.         START render
  89.     END
  90.     
  91.     AT 5                /* what to do at frame 5 */
  92.         START blink            /* set it rolling */
  93.     END
  94.     
  95.     AT 25                /* what to do at frame 18 */
  96.         START blink            /* longer blink this time.. */
  97.         closingtime = 7        /* ..by overriding default */
  98.     END
  99.     
  100.     
  101.     END
  102.