home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1995 September / PCPRO2_995.ISO / virtek / dos / shapes / examples / exam#08.sh < prev    next >
Encoding:
Text File  |  1995-07-16  |  6.3 KB  |  242 lines

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;;;;;                                              ;;;;;;;;
  3. ;;;;;;;;  Example Shape #8 - Shape #4 animated using  ;;;;;;;;
  4. ;;;;;;;;  IFSEM to call the frames & using the same   ;;;;;;;;
  5. ;;;;;;;;  VERTEX reference numbers for each frame.    ;;;;;;;;
  6. ;;;;;;;;                                              ;;;;;;;;
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9.     SHAPE 10000
  10.  
  11. ;;;;;;;;;vertex list;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13.     VERTEX 01,30,-15,+90
  14.     VERTEX 02,30,+15,+90
  15.     VERTEX 03,30,+10,-70
  16.     VERTEX 04,30,-15,-90
  17.  
  18.     VERTEX 05,030,-5,+40
  19.     VERTEX 08,030,-5,-20
  20.     VERTEX 09,030,+5,+40
  21.     VERTEX 10,030,+5,-20
  22.  
  23.     VERTEX 101,-30,-15,+90
  24.     VERTEX 102,-30,+15,+90
  25.     VERTEX 103,-30,+10,-70
  26.     VERTEX 104,-30,-15,-90
  27.  
  28.     VERTEX 105,-030,-5,+40
  29.     VERTEX 108,-030,-5,-20
  30.     VERTEX 109,-030,+5,+40
  31.     VERTEX 110,-030,+5,-20
  32.  
  33.     VERTEX 100,0,5,120
  34.  
  35.     VERTEX 200,00,-15,-50
  36.     VERTEX 201,+5,-15,-90
  37.     VERTEX 202,00,-50,-110
  38.     VERTEX 203,-5,-15,-90
  39.  
  40. ;;;;;;;;;condition list;;;;;;;;;;;;;;;;;;;
  41.  
  42.     IFSEM=0 GOSUB frame_0    ;All these IFSEM commands check the value of
  43.     IFSEM=1 GOSUB frame_1    ;the SEM flags (as set by the PARENT PROGRAM)
  44.     IFSEM=2 GOSUB frame_2    ;If no flags are set (1st line) then the label
  45.     IFSEM=3 GOSUB frame_3    ;"frame_0" is jumped to. If the 1st flag alone
  46.     IFSEM=4 GOSUB frame_4    ;is set, "frame_1" is jumped to. if the 2nd 
  47.     IFSEM=5 GOSUB frame_5    ;flag alone is set, "frame_2" is jumped to. If
  48.     IFSEM=6 GOSUB frame_6    ;flags 1+2 alone are set then "frame_3" is 
  49.     IFSEM=7 GOSUB frame_7    ;jumped to etc...
  50.     IFSEM=8 GOSUB frame_8    ;The modules being jumped to simply contain the 
  51.     IFSEM=9 GOSUB frame_9    ;same four vertices that define the left and
  52.     IFSEM=10 GOSUB frame_10    ;right wing tips, but in different positions.
  53.     IFSEM=11 GOSUB frame_11    ;Because only one of the modules can be called 
  54.     IFSEM=12 GOSUB frame_12    ;at any one time during the course of the main 
  55.     IFSEM=13 GOSUB frame_13    ;program loop it is quite safe to reference the 
  56.     IFSEM=14 GOSUB frame_14    ;same vertices many times without fear of 
  57.     IFSEM=15 GOSUB frame_15    ;causing a "DUPLICATE VERTEX" error.
  58.     IFSEM=16 GOSUB frame_16    ;
  59.     IFSEM=17 GOSUB frame_17    ;There are 21 frames called in this example,
  60.     IFSEM=18 GOSUB frame_18    ;but anything up to 256 is possible.
  61.     IFSEM=19 GOSUB frame_19    ;
  62.     IFSEM=20 GOSUB frame_20    ;
  63.  
  64.     IFVIS 4,1,2 GOTO right_view        ;The comments and notes that accompany
  65.     IFVIS 102,101,104 GOTO left_view    ;these lines can be found in EXAMPLE#4
  66.                     ;which is where these lines and the 
  67.     GOSUB left_wing            ;facet lists below originally came from.
  68.     GOSUB right_wing            ;
  69.     GOTO body                ;
  70.                     ;
  71. right_view:                ;
  72.     GOSUB left_wing            ;
  73.     GOSUB body            ;
  74.     GOTO right_wing            ;
  75.                     ;
  76. left_view:                ;
  77.     GOSUB right_wing            ;
  78.     GOSUB body            ;
  79.     GOTO left_wing            ;
  80.                     ;
  81. ;;;;;;;;;modules;;;;;;;;;;;;;;;;;;;;;;;    ;
  82.                     ;
  83. body:                    ;
  84.     DRWPOLY 31,1,4,104,101        ;
  85.     DRWPOLY 30,200,201,202        ;
  86.     DRWPOLY 29,202,203,200        ;
  87.     DRWPOLY 33,202,201,203        ;
  88.     DRWPOLY 33,1,2,3,4            ;
  89.     DRWPOLY 33,103,102,101,104        ;
  90.     DRWPOLY 35,104,4,3,103        ;
  91.     DRWPOLY 36,103,3,2,102        ;
  92.     DRWPOLY 30,100,1,101        ;
  93.     DRWPOLY 32,100,2,1            ;
  94.     DRWPOLY 32,100,101,102        ;
  95.     DRWPOLY 34,100,102,2        ;
  96.     RETURN                ;
  97.                     ;
  98. left_wing:                ;
  99.     DRWPOLY 34,106,109,105        ;
  100.     DRWPOLY 36,108,110,107        ;
  101.     DRWPOLY 32,108,107,106,105        ;
  102.     DRWPOLY 37,106,107,110,109        ;
  103.     RETURN                ;
  104.                     ;
  105. right_wing:                ;
  106.     DRWPOLY 34,05,09,06            ;The comments and notes that accompany
  107.     DRWPOLY 36,07,10,08            ;these lines can be found in EXAMPLE#4
  108.     DRWPOLY 32,06,07,08,05        ;which is where these lines and the 
  109.     DRWPOLY 37,10,07,06,09        ;condition lists above originally came 
  110.     RETURN                ;from.
  111.  
  112. ;;;;;;;;;animation modules;;;;;;;;;;;;;;;
  113.  
  114. frame_0:    VERTEX 106,-130,50,10    ;This module or one of the following twenty can be 
  115.     VERTEX 107,-130,50,-30    ;called by setting the correct SEM flags. Each one 
  116.     VERTEX 006,130,50,10    ;describes the wing tips in a different position
  117.     VERTEX 007,130,50,-30    ;so when called in sequence by the PARENT PROGRAM 
  118.     RETURN            ;the wings are made to move. (ANIMATION !!)
  119.  
  120. frame_1:    VERTEX 106,-130,45,10
  121.     VERTEX 107,-130,45,-30
  122.     VERTEX 006,130,45,10
  123.     VERTEX 007,130,45,-30
  124.     RETURN
  125.  
  126. frame_2:    VERTEX 106,-130,40,10
  127.     VERTEX 107,-130,40,-30
  128.     VERTEX 006,130,40,10
  129.     VERTEX 007,130,40,-30
  130.     RETURN
  131.  
  132. frame_3:    VERTEX 106,-130,35,10
  133.     VERTEX 107,-130,35,-30
  134.     VERTEX 006,130,35,10
  135.     VERTEX 007,130,35,-30
  136.     RETURN
  137.  
  138. frame_4:    VERTEX 106,-130,30,10
  139.     VERTEX 107,-130,30,-30
  140.     VERTEX 006,130,30,10
  141.     VERTEX 007,130,30,-30
  142.     RETURN
  143.  
  144. frame_5:    VERTEX 106,-130,25,10
  145.     VERTEX 107,-130,25,-30
  146.     VERTEX 006,130,25,10
  147.     VERTEX 007,130,25,-30
  148.     RETURN
  149.  
  150. frame_6:    VERTEX 106,-130,20,10
  151.     VERTEX 107,-130,20,-30
  152.     VERTEX 006,130,20,10
  153.     VERTEX 007,130,20,-30
  154.     RETURN
  155.  
  156. frame_7:    VERTEX 106,-130,15,10
  157.     VERTEX 107,-130,15,-30
  158.     VERTEX 006,130,15,10
  159.     VERTEX 007,130,15,-30
  160.     RETURN
  161.  
  162. frame_8:    VERTEX 106,-130,10,10
  163.     VERTEX 107,-130,10,-30
  164.     VERTEX 006,130,10,10
  165.     VERTEX 007,130,10,-30
  166.     RETURN
  167.  
  168. frame_9:    VERTEX 106,-130,5,10
  169.     VERTEX 107,-130,5,-30
  170.     VERTEX 006,130,5,10
  171.     VERTEX 007,130,5,-30
  172.     RETURN
  173.  
  174. frame_10    VERTEX 106,-130,0,10
  175.     VERTEX 107,-130,0,-30
  176.     VERTEX 006,130,0,10
  177.     VERTEX 007,130,0,-30
  178.     RETURN
  179.  
  180. frame_11    VERTEX 106,-130,-5,10
  181.     VERTEX 107,-130,-5,-30
  182.     VERTEX 006,130,-5,10
  183.     VERTEX 007,130,-5,-30
  184.     RETURN
  185.  
  186. frame_12    VERTEX 106,-130,-10,10
  187.     VERTEX 107,-130,-10,-30
  188.     VERTEX 006,130,-10,10
  189.     VERTEX 007,130,-10,-30
  190.     RETURN
  191.  
  192. frame_13    VERTEX 106,-130,-15,10
  193.     VERTEX 107,-130,-15,-30
  194.     VERTEX 006,130,-15,10
  195.     VERTEX 007,130,-15,-30
  196.     RETURN
  197.  
  198. frame_14    VERTEX 106,-130,-20,10
  199.     VERTEX 107,-130,-20,-30
  200.     VERTEX 006,130,-20,10
  201.     VERTEX 007,130,-20,-30
  202.     RETURN
  203.  
  204. frame_15    VERTEX 106,-130,-25,10
  205.     VERTEX 107,-130,-25,-30
  206.     VERTEX 006,130,-25,10
  207.     VERTEX 007,130,-25,-30
  208.     RETURN
  209.  
  210. frame_16    VERTEX 106,-130,-30,10
  211.     VERTEX 107,-130,-30,-30
  212.     VERTEX 006,130,-30,10
  213.     VERTEX 007,130,-30,-30
  214.     RETURN
  215.  
  216. frame_17    VERTEX 106,-130,-35,10
  217.     VERTEX 107,-130,-35,-30
  218.     VERTEX 006,130,-35,10
  219.     VERTEX 007,130,-35,-30
  220.     RETURN
  221.  
  222. frame_18    VERTEX 106,-130,-40,10
  223.     VERTEX 107,-130,-40,-30
  224.     VERTEX 006,130,-40,10
  225.     VERTEX 007,130,-40,-30
  226.     RETURN
  227.  
  228. frame_19    VERTEX 106,-130,-45,10
  229.     VERTEX 107,-130,-45,-30
  230.     VERTEX 006,130,-45,10
  231.     VERTEX 007,130,-45,-30
  232.     RETURN
  233.  
  234. frame_20    VERTEX 106,-130,-50,10
  235.     VERTEX 107,-130,-50,-30
  236.     VERTEX 006,130,-50,10
  237.     VERTEX 007,130,-50,-30
  238.     RETURN
  239.  
  240.     END
  241.  
  242.