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

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;;;;;                                             ;;;;;;;;
  3. ;;;;;;;;  Example Shape #7 - Modules called by flag  ;;;;;;;;
  4. ;;;;;;;;  settings.                                  ;;;;;;;;
  5. ;;;;;;;;  N.B. Gouraud and textured mapped polygons  ;;;;;;;;
  6. ;;;;;;;;  unavailable in PERSONNAL EDITION.          ;;;;;;;;
  7. ;;;;;;;;                                             ;;;;;;;;
  8. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  9.  
  10.     SHAPE 15000
  11.  
  12. ;;;;;;;;;;vertex list;;;;;;;;;;;;;;;;;;;;;;
  13.  
  14.     VERTEX 1,-200,-200,-200
  15.     VERTEX 2,200,-200,-200
  16.     VERTEX 3,200,200,-200
  17.     VERTEX 4,-200,200,-200
  18.     VERTEX 5,-200,-200,200
  19.     VERTEX 6,200,-200,200
  20.     VERTEX 7,200,200,200
  21.     VERTEX 8,-200,200,200
  22.  
  23. ;;;;;;;;;;condition list;;;;;;;;;;;;;;;;;;;
  24.  
  25.     IFSEM 1 GOTO lines        ;These four lines check if any of the fisrt
  26.     IFSEM 2 GOTO poly1        ;four animation flags are set, jumping to a
  27.     IFSEM 4 GOTO poly2        ;particular module if so. The modules are
  28.     IFSEM 8 GOTO poly3        ;being called by a GOTO command so only the
  29.                 ;first module called will be run. Changing
  30.                 ;the GOTOs to GOSUBs will allow all four
  31.                 ;modules to be toggled ON/OFF together.
  32.  
  33. ;;;;;;;;;;facet list;;;;;;;;;;;;;;;;;;;;;;;
  34.  
  35.     DRWQUAD 2,1        ;These lines simply display the eight
  36.     DRWQUAD 2,2        ;vertices that define the cube by 
  37.     DRWQUAD 2,3        ;drawing a QUAD (four pixels) at each 
  38.     DRWQUAD 2,4        ;vertex location.
  39.     DRWQUAD 2,5        ;If any of the SEMAPHORE FLAGS are set,
  40.     DRWQUAD 2,6        ;these lines are never reached due to 
  41.     DRWQUAD 2,7        ;the fact that the modules are being 
  42.     DRWQUAD 2,8        ;called by a GOTO and not a GOSUB. 
  43.  
  44.     RETURN
  45.  
  46. ;;;;;;;;;;modules;;;;;;;;;;;;;;;;;;;;;;;;;;
  47.  
  48. lines:    DRWLINE 16,1,2        ;This module handles the wireframe image
  49.     DRWLINE 16,2,3        ;of the cube and is called when the
  50.     DRWLINE 16,3,4        ;first animation flag (value 1) is set.
  51.     DRWLINE 16,4,1        ;
  52.     DRWLINE 16,5,6        ;
  53.     DRWLINE 16,6,7        ;
  54.     DRWLINE 16,7,8        ;
  55.     DRWLINE 16,8,5        ;
  56.     DRWLINE 16,1,5        ;
  57.     DRWLINE 16,2,6        ;
  58.     DRWLINE 16,3,7        ;
  59.     DRWLINE 16,4,8        ;
  60.  
  61.     RETURN
  62.  
  63. poly1:    DRWPOLY 30,1,2,3,4        ;This module handles the flat-shaded
  64.     DRWPOLY 31,5,6,2,1        ;single-colour image of the cube and
  65.     DRWPOLY 32,5,1,4,8        ;is called when the second animation 
  66.     DRWPOLY 32,2,6,7,3        ;flag (value 2) is set.
  67.     DRWPOLY 33,4,3,7,8        ;
  68.     DRWPOLY 34,8,7,6,5        ;
  69.  
  70.     RETURN
  71.  
  72. poly2:    DRWPOLY a120,1,2,3,4        ;This module handles the 50% stippled
  73.     DRWPOLY a121,5,6,2,1        ;image of the cube and is called when
  74.     DRWPOLY a122,5,1,4,8        ;the third animation flag (value 4) is 
  75.     DRWPOLY a122,2,6,7,3        ;set.
  76.     DRWPOLY a123,4,3,7,8        ;
  77.     DRWPOLY a124,8,7,6,5        ;
  78.  
  79.     RETURN
  80.  
  81. poly3:    DRWPOLY j64,1,2,3,4        ;This module handles the pattern-shaded
  82.     DRWPOLY j80,5,6,2,1        ;image of the cube and is called when
  83.     DRWPOLY j112,5,1,4,8        ;the fourth animation flag (value 8) is 
  84.     DRWPOLY j112,2,6,7,3        ;set.
  85.     DRWPOLY j80,4,3,7,8        ;
  86.     DRWPOLY j64,8,7,6,5        ;
  87.  
  88.     RETURN
  89.  
  90.     END
  91.  
  92.