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

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;;;;;;;                                             ;;;;;;;;
  3. ;;;;;;;;  Example Shape #9 - 3 different "entities"  ;;;;;;;;
  4. ;;;;;;;;  drawn from only 1 set of VERTICES and      ;;;;;;;;
  5. ;;;;;;;;  DRWcommands using the RECENTER command     ;;;;;;;;
  6. ;;;;;;;;                                             ;;;;;;;;
  7. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  8.  
  9.     SHAPE 10000
  10.  
  11. ;;;;;;;;;;vertex list;;;;;;;;;;;;;;;;;;;;;;
  12.  
  13.     VERTEX 9,-400,0,0        ;These two vertices are used solely by the RECENTER
  14.     VERTEX 10,400,0,0        ;commands below as different origins for the 
  15.                 ;vertices in the module "cube".
  16.  
  17. ;;;;;;;;;;"condition list";;;;;;;;;;;;;;;;;
  18.  
  19.     GOSUB cube        ;This line simply calls the module "cube", drawing 
  20.                 ;the middle cube using the pure vertices as defined 
  21.                 ;exactly in the module "CUBE" below.
  22.  
  23.     RECENTER 09,cube        ;This line calls the module "CUBE" but recenters 
  24.                 ;any following vertices around vertex 9, drawing 
  25.                 ;the left-hand cube.
  26.  
  27.     RECENTER 10,cube,(0,45,45)    ;This line calls the module "CUBE", not only 
  28.                 ;recentering any following vertices around vertex 
  29.                 ;10, but also rotating them all 45 degrees in the Y 
  30.                 ;and Z axis (pitch and roll) drawing the right-hand 
  31.                 ;cube.
  32.  
  33.     RETURN            ;This RETURN ensures that processing does not 
  34.                 ;continue into the module below after the last 
  35.                 ;RECENTER command.
  36.  
  37. ;;;;;;;;;;modules;;;;;;;;;;;;;;;;;;;;;;;;;;
  38.  
  39. cube:
  40.     VERTEX 1,-100,-100,-100    ;These vertices are recompiled each time the module
  41.     VERTEX 2,100,-100,-100    ;"CUBE" is called. When called by RECENTER, the
  42.     VERTEX 3,100,100,-100    ;origin ceases to be 0,0,0 and becomes instead the
  43.     VERTEX 4,-100,100,-100    ;coordinate specified by the vertex parameter in 
  44.     VERTEX 5,-100,-100,100    ;the RECENTER command.
  45.     VERTEX 6,100,-100,100    ;
  46.     VERTEX 7,100,100,100    ;
  47.     VERTEX 8,-100,100,100    ;
  48.  
  49.     DRWPOLY 16,1,2,3,4        ;These lines are simply the six sides of the cube.
  50.     DRWPOLY 18,6,5,8,7        ;
  51.     DRWPOLY 20,1,4,8,5        ;
  52.     DRWPOLY 22,6,7,3,2        ;
  53.     DRWPOLY 24,4,3,7,8        ;
  54.     DRWPOLY 26,5,6,2,1        ;
  55.  
  56.     RETURN
  57.  
  58. ;Because this shape file needs to be as simple as possible for RECENTER to be properly 
  59. ;understood, no SORTING has been done so as not to complicate the program description.
  60. ;Consequently the compiled shape will not sort correctly but the effect and purpose of
  61. ;RECENTER can still be seen.
  62.  
  63.     END
  64.