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

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;;;;;                                             ;;;;;;;;
  3. ;;;;;;;;  Example Shape #11 - IFDIST used to reduce  ;;;;;;;;
  4. ;;;;;;;;  the detail and consequent render time.     ;;;;;;;;
  5. ;;;;;;;;                                             ;;;;;;;;
  6. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  7.  
  8.     SHAPE 10000
  9.  
  10. ;;;;;;;;;;vertex list;;;;;;;;;;;;;;;;;;;;;;;
  11.  
  12.     VERTEX 1,-100,-25,0
  13.     VERTEX 2,100,-25,0
  14.     VERTEX 3,100,25,0
  15.     VERTEX 4,-100,25,0
  16.  
  17.     VERTEX 11,-72,-15,0
  18.     VERTEX 12,-60,-15,0
  19.     VERTEX 13,-48,-15,0
  20.     VERTEX 14,-36,-15,0
  21.     VERTEX 15,-24,-15,0
  22.     VERTEX 16,-12,-15,0
  23.     VERTEX 17,-00,-15,0
  24.     VERTEX 18,-00,+15,0
  25.     VERTEX 19,-12,+15,0
  26.     VERTEX 20,-24,+15,0
  27.     VERTEX 21,-36,+15,0
  28.     VERTEX 22,-48,+15,0
  29.     VERTEX 23,-60,+15,0
  30.     VERTEX 24,-72,+15,0
  31.  
  32.     VERTEX 25,-66,-05,0
  33.     VERTEX 26,-60,-05,0
  34.     VERTEX 27,-72,+05,0
  35.     VERTEX 28,-66,+05,0
  36.  
  37.     VERTEX 29,-54,-05,0
  38.     VERTEX 30,-54,+05,0
  39.     VERTEX 31,-54,+01,0
  40.     VERTEX 32,-48,+01,0
  41.  
  42.     VERTEX 33,-42,-05,0
  43.     VERTEX 34,-42,+05,0
  44.  
  45.     VERTEX 35,-30,-09,0
  46.     VERTEX 36,-30,-05,0
  47.     VERTEX 37,-30,+05,0
  48.     VERTEX 38,-30,+15,0
  49.     VERTEX 39,-26,+01,0
  50.     VERTEX 40,-24,+01,0
  51.  
  52.     VERTEX 41,-18,-05,0
  53.     VERTEX 42,-18,+05,0
  54.     VERTEX 43,-18,+01,0
  55.     VERTEX 44,-12,+01,0
  56.  
  57.     VERTEX 45,-06,-15,0
  58.     VERTEX 46,-06,-05,0
  59.     VERTEX 47,-06,+05,0
  60.     VERTEX 48,-06,+15,0
  61.  
  62. ;;;;;;;;;;facet list;;;;;;;;;;;;;;;;;;;;;;;;
  63.  
  64.     DRWPOLY 140,4,3,2,1        ;These two lines simply draw the front and
  65.     DRWPOLY 130,1,2,3,4        ;back of the sign board.
  66.  
  67.     IFDIST > 600 GOTO far    ;This line checks if the object is more than
  68.                 ;600 UNITS away, jumping to the label "FAR"
  69.                 ;if satisfied.
  70.  
  71.     IFVIS 2,1,4 GOTO notext    ;This line checks if the front is NOT visible
  72.                 ;(by checking if the back IS visible) and 
  73.                 ;skips drawing the "SCORCH" text lines below  
  74.                 ;if satisfied.
  75.  
  76. ;VERTICES 11 TO 48 COULD BE PLACED HERE TO FURTHER SPEED RENDER TIME.
  77. ;At the moment, vertices 11-48 are always being compiled on each pass through the 
  78. ;shape. When the front panel is not visible, the vertices are unrequired and 
  79. ;consequently taking up render time for no reason. The IFVIS check above ignores
  80. ;all the following lines until the label NOFRONT, and that includes recompiling
  81. ;any vertices found here too.
  82.  
  83.     DRWPOLY 16,11,17,18,24    ;These lines draw the simple but effective
  84.     DRWLINE 47,11,17        ;"SCORCH" text seen on the front of the panel.
  85.     DRWLINE 47,24,18        ;They are ignored completely if the back is 
  86.     DRWLINE 47,11,24        ;visible or the shape is more than 600 UNITS
  87.     DRWLINE 47,12,23        ;away. This obviously speeds up render time
  88.     DRWLINE 47,13,22        ;as no work is being done unnecessarily.
  89.     DRWLINE 47,14,21        ;
  90.     DRWLINE 47,15,20        ;
  91.     DRWLINE 47,16,19        ;
  92.     DRWLINE 47,17,18        ;
  93.     DRWLINE 47,25,26        ;
  94.     DRWLINE 47,27,28        ;
  95.     DRWLINE 47,29,30        ;
  96.     DRWLINE 47,31,32        ;
  97.     DRWLINE 47,33,34        ;
  98.     DRWLINE 47,35,36        ;
  99.     DRWLINE 47,37,38        ;
  100.     DRWLINE 47,39,40        ;
  101.     DRWLINE 47,41,42        ;
  102.     DRWLINE 47,43,44        ;
  103.     DRWLINE 47,45,46        ;
  104.     DRWLINE 47,47,48        ;
  105.  
  106. notext:
  107.     RETURN
  108.  
  109. far:    DRWPOLY 47,11,17,18,24    ;This line is only called when the shape is
  110.                 ;more than 600 UNITS away. It simply draws a 
  111.                 ;flat facet in place of the "SCORCH" text.
  112.     RETURN
  113.     END
  114.  
  115.