;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;                                             ;;;;;;;;
;;;;;;;;  Example Shape #7 - Modules called by flag  ;;;;;;;;
;;;;;;;;  settings.                                  ;;;;;;;;
;;;;;;;;  N.B. Gouraud and textured mapped polygons  ;;;;;;;;
;;;;;;;;  unavailable in PERSONNAL EDITION.          ;;;;;;;;
;;;;;;;;                                             ;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

	SHAPE 15000

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

	VERTEX 1,-200,-200,-200
	VERTEX 2,200,-200,-200
	VERTEX 3,200,200,-200
	VERTEX 4,-200,200,-200
	VERTEX 5,-200,-200,200
	VERTEX 6,200,-200,200
	VERTEX 7,200,200,200
	VERTEX 8,-200,200,200

;;;;;;;;;;condition list;;;;;;;;;;;;;;;;;;;

	IFSEM 1 GOTO lines		;These four lines check if any of the fisrt
	IFSEM 2 GOTO poly1		;four animation flags are set, jumping to a
	IFSEM 4 GOTO poly2		;particular module if so. The modules are
	IFSEM 8 GOTO poly3		;being called by a GOTO command so only the
				;first module called will be run. Changing
				;the GOTOs to GOSUBs will allow all four
				;modules to be toggled ON/OFF together.

;;;;;;;;;;facet list;;;;;;;;;;;;;;;;;;;;;;;

	DRWQUAD 2,1		;These lines simply display the eight
	DRWQUAD 2,2		;vertices that define the cube by 
	DRWQUAD 2,3		;drawing a QUAD (four pixels) at each 
	DRWQUAD 2,4		;vertex location.
	DRWQUAD 2,5		;If any of the SEMAPHORE FLAGS are set,
	DRWQUAD 2,6		;these lines are never reached due to 
	DRWQUAD 2,7		;the fact that the modules are being 
	DRWQUAD 2,8		;called by a GOTO and not a GOSUB. 

	RETURN

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

lines:	DRWLINE 16,1,2		;This module handles the wireframe image
	DRWLINE 16,2,3		;of the cube and is called when the
	DRWLINE 16,3,4		;first animation flag (value 1) is set.
	DRWLINE 16,4,1		;
	DRWLINE 16,5,6		;
	DRWLINE 16,6,7		;
	DRWLINE 16,7,8		;
	DRWLINE 16,8,5		;
	DRWLINE 16,1,5		;
	DRWLINE 16,2,6		;
	DRWLINE 16,3,7		;
	DRWLINE 16,4,8		;

	RETURN

poly1:	DRWPOLY 30,1,2,3,4		;This module handles the flat-shaded
	DRWPOLY 31,5,6,2,1		;single-colour image of the cube and
	DRWPOLY 32,5,1,4,8		;is called when the second animation 
	DRWPOLY 32,2,6,7,3		;flag (value 2) is set.
	DRWPOLY 33,4,3,7,8		;
	DRWPOLY 34,8,7,6,5		;

	RETURN

poly2:	DRWPOLY a120,1,2,3,4		;This module handles the 50% stippled
	DRWPOLY a121,5,6,2,1		;image of the cube and is called when
	DRWPOLY a122,5,1,4,8		;the third animation flag (value 4) is 
	DRWPOLY a122,2,6,7,3		;set.
	DRWPOLY a123,4,3,7,8		;
	DRWPOLY a124,8,7,6,5		;

	RETURN

poly3:	DRWPOLY j64,1,2,3,4		;This module handles the pattern-shaded
	DRWPOLY j80,5,6,2,1		;image of the cube and is called when
	DRWPOLY j112,5,1,4,8		;the fourth animation flag (value 8) is 
	DRWPOLY j112,2,6,7,3		;set.
	DRWPOLY j80,4,3,7,8		;
	DRWPOLY j64,8,7,6,5		;

	RETURN

	END

