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

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;;;;;                                             ;;;;;;;;
  3. ;;;;;;;;  Example Shape #6 - Parts of the shape are  ;;;;;;;;
  4. ;;;;;;;;  "skipped" when not visible using IFVIS to  ;;;;;;;;
  5. ;;;;;;;;  check the reverse of "theoretical" facets  ;;;;;;;;
  6. ;;;;;;;;                                             ;;;;;;;;
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9.     SHAPE 10000
  10.  
  11. ;;;;;;;;;;vertex list;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13.     VERTEX 01,00,-120,-20
  14.     VERTEX 02,114,-36,-20
  15.     VERTEX 03,70,98,-20
  16.     VERTEX 04,-70,98,-20
  17.     VERTEX 05,-114,-36,-20
  18.     VERTEX 06,28,-36,-20
  19.     VERTEX 07,44,16,-20
  20.     VERTEX 08,00,48,-20
  21.     VERTEX 09,-44,16,-20
  22.     VERTEX 10,-28,-36,-20
  23.  
  24.     VERTEX 11,00,-120,20
  25.     VERTEX 12,114,-36,20
  26.     VERTEX 13,70,98,20
  27.     VERTEX 14,-70,98,20
  28.     VERTEX 15,-114,-36,20
  29.     VERTEX 16,28,-36,20
  30.     VERTEX 17,44,16,20
  31.     VERTEX 18,00,48,20
  32.     VERTEX 19,-44,16,20
  33.     VERTEX 20,-28,-36,20
  34.  
  35. ;;;;;;;;;;facet list;;;;;;;;;;;;;;;;;;;;;;;
  36.  
  37.     IFVIS 18,20,16 GOTO no_hole    ;this one line checks if the cavity mouth is 
  38.                 ;NOT visible by checking the reverse side of
  39.                 ;the hole. If the check is TRUE then the hole
  40.                 ;mouth is not visible and the following seven
  41.                 ;DRWcommands are bypassed by the GOTO command.
  42.                 ;Note how the three vertices used do not belong
  43.                 ;to an actual facet but a THEORETICAL FACET
  44.                 ;that defines the hole mouth.
  45.  
  46.     DRWPOLY 091,10,06,16,20    ;these facets belong to the 
  47.     DRWPOLY 090,06,07,17,16    ;cavity in the back of the 
  48.     DRWPOLY 088,07,08,18,17    ;star.
  49.     DRWPOLY 089,08,09,19,18    ;
  50.     DRWPOLY 090,09,10,20,19    ;
  51.     DRWPOLY 092,06,10,09    ;
  52.     DRWPOLY 092,08,07,06,09    ;
  53.  
  54. no_hole:
  55.  
  56.     DRWPOLY 220,01,10,20,11    ;these 10 facets make up the
  57.     DRWPOLY 220,02,06,16,12    ;outside edge of the star. The
  58.     DRWPOLY 220,03,07,17,13    ;same colour trick has been used
  59.     DRWPOLY 220,04,08,18,14    ;to avoid sorting as can be seen 
  60.     DRWPOLY 220,05,09,19,15    ;in EXAMPLE#03.
  61.     DRWPOLY 218,10,05,15,20    ;
  62.     DRWPOLY 218,09,04,14,19    ;
  63.     DRWPOLY 218,08,03,13,18    ;
  64.     DRWPOLY 218,07,02,12,17    ;
  65.     DRWPOLY 218,06,01,11,16    ;
  66.  
  67.     IFVIS 1,4,3 GOTO no_face    ;this line checks if the star face is NOT visible
  68.                 ;by checking its reverse side. Again, note that
  69.                 ;the three vertices used in this check do not
  70.                 ;belong to any one existing facet but cover the
  71.                 ;largest area of the face being tested. It is wise
  72.                 ;to check the largest surface area as this avoids
  73.                 ;possible IFVIS errors arising from performing the
  74.                 ;maths on very small areas.
  75.  
  76.     DRWPOLY 216,01,06,10    ;these 7 facets make the front
  77.     DRWPOLY 216,02,07,06    ;face of the star 
  78.     DRWPOLY 216,03,08,07    ;
  79.     DRWPOLY 216,04,09,08    ;
  80.     DRWPOLY 216,05,10,09    ;
  81.     DRWPOLY 216,09,10,06    ;
  82.     DRWPOLY 216,06,07,08,09    ;
  83.  
  84. no_face:
  85.  
  86.     DRWPOLY 222,20,16,11    ;these 5 facets make the back
  87.     DRWPOLY 222,16,17,12    ;face of the star 
  88.     DRWPOLY 222,17,18,13    ;
  89.     DRWPOLY 222,18,19,14    ;
  90.     DRWPOLY 222,19,20,15    ;
  91.  
  92.     RETURN
  93.     END
  94.