;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;                                             ;;;;;;;;
;;;;;;;;  Example Shape #9 - 3 different "entities"  ;;;;;;;;
;;;;;;;;  drawn from only 1 set of VERTICES and      ;;;;;;;;
;;;;;;;;  DRWcommands using the RECENTER command     ;;;;;;;;
;;;;;;;;                                             ;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	SHAPE 10000

;;;;;;;;;;vertex list;;;;;;;;;;;;;;;;;;;;;;

	VERTEX 9,-400,0,0		;These two vertices are used solely by the RECENTER
	VERTEX 10,400,0,0		;commands below as different origins for the 
				;vertices in the module "cube".

;;;;;;;;;;"condition list";;;;;;;;;;;;;;;;;

	GOSUB cube		;This line simply calls the module "cube", drawing 
				;the middle cube using the pure vertices as defined 
				;exactly in the module "CUBE" below.

	RECENTER 09,cube		;This line calls the module "CUBE" but recenters 
				;any following vertices around vertex 9, drawing 
				;the left-hand cube.

	RECENTER 10,cube,(0,45,45)	;This line calls the module "CUBE", not only 
				;recentering any following vertices around vertex 
				;10, but also rotating them all 45 degrees in the Y 
				;and Z axis (pitch and roll) drawing the right-hand 
				;cube.

	RETURN			;This RETURN ensures that processing does not 
				;continue into the module below after the last 
				;RECENTER command.

;;;;;;;;;;modules;;;;;;;;;;;;;;;;;;;;;;;;;;

cube:
	VERTEX 1,-100,-100,-100	;These vertices are recompiled each time the module
	VERTEX 2,100,-100,-100	;"CUBE" is called. When called by RECENTER, the
	VERTEX 3,100,100,-100	;origin ceases to be 0,0,0 and becomes instead the
	VERTEX 4,-100,100,-100	;coordinate specified by the vertex parameter in 
	VERTEX 5,-100,-100,100	;the RECENTER command.
	VERTEX 6,100,-100,100	;
	VERTEX 7,100,100,100	;
	VERTEX 8,-100,100,100	;

	DRWPOLY 16,1,2,3,4		;These lines are simply the six sides of the cube.
	DRWPOLY 18,6,5,8,7		;
	DRWPOLY 20,1,4,8,5		;
	DRWPOLY 22,6,7,3,2		;
	DRWPOLY 24,4,3,7,8		;
	DRWPOLY 26,5,6,2,1		;

	RETURN

;Because this shape file needs to be as simple as possible for RECENTER to be properly 
;understood, no SORTING has been done so as not to complicate the program description.
;Consequently the compiled shape will not sort correctly but the effect and purpose of
;RECENTER can still be seen.

	END
