rotmodelbegin=$

;вращение произвольной вершины
	macro ROTVERTEX2 x,z,y
	if (x&#8000)==0
	;display "x>=0 x=",x
_x=(#1f-x)
_xsgn=0
	else
	;display "x<0 x=",x
_x=(#1f+x)
_xsgn=1
	endif
_x=_x+#40
	if (z&#8000)==0 ;display "z>=0 z=",z
_z=(#1f-z)
_zsgn=0
	else ;display "z<0 z=",z
_z=(#1f+z)
_zsgn=1
	endif
_z=_z+#60
	if (y&#8000)==0 ;display "y>=0 y=",y
_y=(#1f-y)
_ysgn=0
	else ;display "y<0 y=",y
_y=(#1f+y)
_ysgn=1
	endif
_y=_y+#20
	if z;(TWOAXES==0)||(_z != 0)
_usede=1
	else
_usede=0
	endif
	 if _usede
	 ld de,#100*_z+_x
	 endif
	ld hl,CUTS+_y ;засечки
	;ld b,l
	if y
	if _ysgn
	xor a
	sub (hl)
	else
	ld a,(hl)
	endif
	else
	xor a
	endif
	if z
	if TWOAXES==0
	 if _usede
	 ld l,d
	 else
	 ld l,_z
	 endif
	if _zsgn
	sub (hl) ;(=0 без крена)
	else
	add a,(hl) ;(=0 без крена)
	endif
	endif
	endif
	if x
	 if _usede
	 ld l,e
	 else
	 ld l,_x
	 endif
	if _xsgn
	sub (hl)
	else
	add a,(hl)
	endif
	endif
	ld c,a ;x'

	inc h

	if x
	if _xsgn
	xor a
	sub (hl)
	else
	ld a,(hl)
	endif
	else
	xor a
	endif
	if z
	 if _usede
	 ld l,d
	 else
	 ld l,_z
	 endif
	if _zsgn
	sub (hl)
	else
	add a,(hl)
	endif
	endif
	if y
	ld l,_y;b
	if _ysgn
	sub (hl)
	else
	add a,(hl)
	endif
	endif
	ld b,a ;y'
	
	inc h

	if y
	if _ysgn
	xor a
	sub (hl)
	else
	ld a,(hl)
	endif
	else
	xor a
	endif
	if z
	 if _usede
	 ld l,d
	 else
	 ld l,_z
	 endif
	if _zsgn
	sub (hl)
	else
	add a,(hl)
	endif
	endif
	if x
	 if _usede
	 ld l,e
	 else
	 ld l,_x
	 endif
	if _xsgn
	sub (hl)
	else
	add a,(hl)
	endif
	endif
	;z'
	call div8xinch
	push bc
__=$
	endm

;-sz/0/+sz можно сделать так:
        MACRO ASCUBE sign
	if sign
	 if _hl^_hlneed
	  if (_hl^_hlneed)&#ff00
	   ld hl,_hlneed
	  else
	   if ((_hlneed-(_hl+1))&#ff)==0
	    inc l
	   else
	    ld l,_hlneed&#ff
	   endif
	  endif
_hl=_hlneed
	 endif
	 if ((sign&#8000)==0)
    if _==0
        LD A,(HL)
    else
        ADD A,(HL)
    endif
_=1
	 else ;((sign&#8000)!=0)
    if _==0
	xor a
        sub (HL)
    else
        sub (HL)
    endif
_=1
	 endif
	endif ;sign
_hlneed=_hlneed+1
        ENDM 

;вращение вершины -sz/0/+sz
	macro ROTVERTEX x,z,y
_hlneed=_MATRIX
_=0
	if TWOAXES==0
        ASCUBE z ;(=0 без крена) ;не проверено
	endif
        ASCUBE x
        ASCUBE y
;a=x=-127..+127
	if _==0
	ld c,0
	else
	ld c,a
	endif
_=0
        ASCUBE z
        ASCUBE x
        ASCUBE y
;a=y=-127..+127
	if _==0
	ld b,0;e,0
	else
	ld b,a;e,a
	endif
_=0
        ASCUBE z
        ASCUBE x
        ASCUBE y
	if _==0
	xor a
	endif
;a=z=-127..+127
	CALLDIVX 0 ;c
_hl=0
	push bc
__=$
	endm








        
        
        
        
        
        
        
        
     
     
_MATRIX=MATRIX
_hl=0   
sz=31 ;единичные объекты   
;-------------------------------------------------------------------        
; куб элементарный       
;------------------------------------------------------------------- 
ROTCUBESIMPLE
	ROTATEBEGIN
                  ;X Z Y
        ROTVERTEX +sz,+sz,+sz
        ROTVERTEX +sz,+sz,-00
        ROTVERTEX +sz,-00,-00
        ROTVERTEX +sz,-00,+sz
        ROTVERTEX -00,+sz,+sz
        ROTVERTEX -00,+sz,-00
        ROTVERTEX -00,-00,-00
        ROTVERTEX -00,-00,+sz
	ld hl,polycube
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBESIMPLE size=",/D,$-ROTCUBESIMPLE    

 
_MATRIX=MATRIX2  
;-------------------------------------------------------------------      
; плитка элементарная
;------------------------------------------------------------------- 
ROTPLITKA
	ROTATEBEGIN
sz=31
                   ;X Z Y
        ROTVERTEX2 +sz,-00,+sz;00
        ROTVERTEX2 +sz,-00,-sz;00
        ROTVERTEX2 -sz,+00,-sz;00
        ROTVERTEX2 -sz,-00,+sz;00
	ld hl,polyplitka
	call drawfaces
	jp sortobjnext
	;display "   ROTPLITKA size=",/D,$-ROTPLITKA 
;-------------------------------------------------------------------        
; куб 64x64x64      
;------------------------------------------------------------------- 
sz=31
ROTCUBE64x64x64
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +sz,+sz,+sz ;0
        ROTVERTEX2 +sz,+sz,-sz ;1
        ROTVERTEX2 +sz,-sz,-sz ;2
        ROTVERTEX2 +sz,-sz,+sz ;3
        ROTVERTEX2 -sz,+sz,+sz ;4
        ROTVERTEX2 -sz,+sz,-sz ;5
        ROTVERTEX2 -sz,-sz,-sz ;6
        ROTVERTEX2 -sz,-sz,+sz ;7
	ld hl,polycube
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE64x64x64 size=",/D,$-ROTCUBE64x64x64 
;-------------------------------------------------------------------        
; стенка 32x64x64      
;------------------------------------------------------------------- 
sz=31
ROTCUBE32x64x64
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +16,+sz,+sz ;0
        ROTVERTEX2 +16,+sz,-sz ;1
        ROTVERTEX2 +16,-sz,-sz ;2
        ROTVERTEX2 +16,-sz,+sz ;3
        ROTVERTEX2 -16,+sz,+sz ;4
        ROTVERTEX2 -16,+sz,-sz ;5
        ROTVERTEX2 -16,-sz,-sz ;6
        ROTVERTEX2 -16,-sz,+sz ;7
	ld hl,polycube
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE32x64x64 size=",/D,$-ROTCUBE32x64x64   
;-------------------------------------------------------------------        
; кривая колонна 32x32x64ugol      
;------------------------------------------------------------------- 
sz=12
ROTCUBE32x32x64ugol
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +sz,+31,+sz ;0
        ROTVERTEX2 +sz,+31,-sz ;1
        ROTVERTEX2 +2*sz,-31,-sz ;2
        ROTVERTEX2 +2*sz,-31,+sz ;3
        ROTVERTEX2 -sz,+31,+sz ;4
        ROTVERTEX2 -sz,+31,-sz ;5
        ROTVERTEX2 -00,-31,-sz ;6
        ROTVERTEX2 -00,-31,+sz ;7
	ld hl,polycube;polycolona
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube;polycolona
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE32x32x64ugol size=",/D,$-ROTCUBE32x32x64ugol         
;-------------------------------------------------------------------        
; колонна 32x32x64      
;------------------------------------------------------------------- 
sz=16
ROTCUBE32x32x64
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +sz,+31,+sz ;0
        ROTVERTEX2 +sz,+31,-sz ;1
        ROTVERTEX2 +sz,-31,-sz ;2
        ROTVERTEX2 +sz,-31,+sz ;3
        ROTVERTEX2 -sz,+31,+sz ;4
        ROTVERTEX2 -sz,+31,-sz ;5
        ROTVERTEX2 -sz,-31,-sz ;6
        ROTVERTEX2 -sz,-31,+sz ;7
	ld hl,polycube;polycolona
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube;polycolona
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE32x32x64 size=",/D,$-ROTCUBE32x32x64 
;-------------------------------------------------------------------        
; колонна 24x24x64      
;------------------------------------------------------------------- 
sz=11
ROTCUBE24x24x64
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +sz,+31,+sz ;0
        ROTVERTEX2 +sz,+31,-sz ;1
        ROTVERTEX2 +sz,-31,-sz ;2
        ROTVERTEX2 +sz,-31,+sz ;3
        ROTVERTEX2 -sz,+31,+sz ;4
        ROTVERTEX2 -sz,+31,-sz ;5
        ROTVERTEX2 -sz,-31,-sz ;6
        ROTVERTEX2 -sz,-31,+sz ;7
	ld hl,polycube;polycolona
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube;polycolona
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE24x24x64 size=",/D,$-ROTCUBE24x24x64 
;-------------------------------------------------------------------        
; колонна 16x16x64      
;------------------------------------------------------------------- 
sz=7
ROTCUBE16x16x64
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +sz,+31,+sz ;0
        ROTVERTEX2 +sz,+31,-sz ;1
        ROTVERTEX2 +sz,-31,-sz ;2
        ROTVERTEX2 +sz,-31,+sz ;3
        ROTVERTEX2 -sz,+31,+sz ;4
        ROTVERTEX2 -sz,+31,-sz ;5
        ROTVERTEX2 -sz,-31,-sz ;6
        ROTVERTEX2 -sz,-31,+sz ;7
	ld hl,polycube;polycolona
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube;polycolona
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE16x16x64 size=",/D,$-ROTCUBE16x16x64         
;-------------------------------------------------------------------        
; плоская плита 64x64x32      
;------------------------------------------------------------------- 
sz=17
ROTCUBE64x64x32
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +31,+sz,+31 ;0
        ROTVERTEX2 +31,+sz,-31 ;1
        ROTVERTEX2 +31,-sz,-31 ;2
        ROTVERTEX2 +31,-sz,+31 ;3
        ROTVERTEX2 -31,+sz,+31 ;4
        ROTVERTEX2 -31,+sz,-31 ;5
        ROTVERTEX2 -31,-sz,-31 ;6
        ROTVERTEX2 -31,-sz,+31 ;7
	ld hl,polycube
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE64x64x32 size=",/D,$-ROTCUBE64x64x32 
;-------------------------------------------------------------------        
; горизонтальный блок 64x32x32      
;------------------------------------------------------------------- 
sz=16
ROTCUBE64x32x32
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +31,+sz,+sz ;0
        ROTVERTEX2 +31,+sz,-sz ;1
        ROTVERTEX2 +31,-sz,-sz ;2
        ROTVERTEX2 +31,-sz,+sz ;3
        ROTVERTEX2 -31,+sz,+sz ;4
        ROTVERTEX2 -31,+sz,-sz ;5
        ROTVERTEX2 -31,-sz,-sz ;6
        ROTVERTEX2 -31,-sz,+sz ;7
	ld hl,polycube
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE64x32x32 size=",/D,$-ROTCUBE64x32x32 
;-------------------------------------------------------------------        
; горизонтальный блок 32x64x32      
;------------------------------------------------------------------- 
sz=16
ROTCUBE32x64x32
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +sz,+sz,+31 ;0
        ROTVERTEX2 +sz,+sz,-31 ;1
        ROTVERTEX2 +sz,-sz,-31 ;2
        ROTVERTEX2 +sz,-sz,+31 ;3
        ROTVERTEX2 -sz,+sz,+31 ;4
        ROTVERTEX2 -sz,+sz,-31 ;5
        ROTVERTEX2 -sz,-sz,-31 ;6
        ROTVERTEX2 -sz,-sz,+31 ;7
	ld hl,polycube
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycube
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBE32x64x32 size=",/D,$-ROTCUBE32x64x32         
;-------------------------------------------------------------------        
; призма 64x64x32      
;------------------------------------------------------------------- 
sz=31
ROTPRIZMA64x64x32
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +31,+17,+31 ;0
        ROTVERTEX2 +31,+17,-31 ;1
        ROTVERTEX2 +31,-17,-31 ;2
        ROTVERTEX2 -31,+17,+31 ;3
        ROTVERTEX2 -31,+17,-31 ;4
        ROTVERTEX2 -31,-17,-31 ;5
	ld hl,polyprizma
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyprizma
	call drawfaces
	jp sortobjnext
	;display "   ROTPRIZMA64x64x32 size=",/D,$-ROTPRIZMA64x64x32 
;-------------------------------------------------------------------        
; призма 32x64x64      
;------------------------------------------------------------------- 
sz=31
ROTPRIZMA32x64x64
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +17,+31,+31 ;0
        ROTVERTEX2 +17,+31,-31 ;1
        ROTVERTEX2 +17,-31,-31 ;2
        ROTVERTEX2 -17,+31,+31 ;3
        ROTVERTEX2 -17,+31,-31 ;4
        ROTVERTEX2 -17,-31,-31 ;5
	ld hl,polyprizma
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyprizma
	call drawfaces
	jp sortobjnext
	;display "   ROTPRIZMA32x64x64 size=",/D,$-ROTPRIZMA32x64x64 
;-------------------------------------------------------------------        
; призма 32x64x64a      
;------------------------------------------------------------------- 
sz=31
ROTPRIZMA32x64x64a
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 -17,+31,-31 ;0
        ROTVERTEX2 -17,+31,+31 ;1
        ROTVERTEX2 -17,-31,+31 ;2
        ROTVERTEX2 +17,+31,-31 ;3
        ROTVERTEX2 +17,+31,+31 ;4
        ROTVERTEX2 +17,-31,+31 ;5
	ld hl,polyprizmaA
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyprizmaA
	call drawfaces
	jp sortobjnext
	;display "   ROTPRIZMA32x64x64a size=",/D,$-ROTPRIZMA32x64x64a         
;-------------------------------------------------------------------        
; арка x64      
;------------------------------------------------------------------- 
ROTARCAx64
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +31,+31,-08 ;0
        ROTVERTEX2 +31,+31,-31 ;1
        ROTVERTEX2 +31,-31,-16 ;2
        ROTVERTEX2 +31,-31,+31 ;3
        ROTVERTEX2 -31,+31,-08 ;4
        ROTVERTEX2 -31,+31,-31 ;5
        ROTVERTEX2 -31,-31,-16 ;6
        ROTVERTEX2 -31,-31,+31 ;7        
        ROTVERTEX2 +31,+00,+31 ;8
        ROTVERTEX2 +31,+00,-00 ;9
        ROTVERTEX2 -31,-00,+31 ;10
        ROTVERTEX2 -31,-00,+00 ;11
	ld hl,polyarca
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyarca
	call drawfaces
	jp sortobjnext
	;display "   ROTARCAx64 size=",/D,$-ROTARCAx64   
;-------------------------------------------------------------------        
; арка x32      
;------------------------------------------------------------------- 
ROTARCAx32
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +15,+31,-08 ;0
        ROTVERTEX2 +15,+31,-31 ;1
        ROTVERTEX2 +15,-31,-16 ;2
        ROTVERTEX2 +15,-31,+31 ;3
        ROTVERTEX2 -15,+31,-08 ;4
        ROTVERTEX2 -15,+31,-31 ;5
        ROTVERTEX2 -15,-31,-16 ;6
        ROTVERTEX2 -15,-31,+31 ;7        
        ROTVERTEX2 +15,+00,+31 ;8
        ROTVERTEX2 +15,+00,-00 ;9
        ROTVERTEX2 -15,-00,+31 ;10
        ROTVERTEX2 -15,-00,+00 ;11
	ld hl,polyarca
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyarca
	call drawfaces
	jp sortobjnext
	;display "   ROTARCAx32 size=",/D,$-ROTARCAx32     
;-------------------------------------------------------------------        
; арка x16      
;------------------------------------------------------------------- 
ROTARCAx16
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +7,+31,-08 ;0
        ROTVERTEX2 +7,+31,-31 ;1
        ROTVERTEX2 +7,-31,-16 ;2
        ROTVERTEX2 +7,-31,+31 ;3
        ROTVERTEX2 -7,+31,-08 ;4
        ROTVERTEX2 -7,+31,-31 ;5
        ROTVERTEX2 -7,-31,-16 ;6
        ROTVERTEX2 -7,-31,+31 ;7        
        ROTVERTEX2 +7,+00,+31 ;8
        ROTVERTEX2 +7,+00,-00 ;9
        ROTVERTEX2 -7,-00,+31 ;10
        ROTVERTEX2 -7,-00,+00 ;11
	ld hl,polyarca
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyarca
	call drawfaces
	jp sortobjnext
	;display "   ROTARCAx16 size=",/D,$-ROTARCAx16 
;-------------------------------------------------------------------        
; арка x64a      
;------------------------------------------------------------------- 
ROTARCAx64a
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 -31,+31,+08 ;0
        ROTVERTEX2 -31,+31,+31 ;1
        ROTVERTEX2 -31,-31,+16 ;2
        ROTVERTEX2 -31,-31,-31 ;3
        ROTVERTEX2 +31,+31,+08 ;4
        ROTVERTEX2 +31,+31,+31 ;5
        ROTVERTEX2 +31,-31,+16 ;6
        ROTVERTEX2 +31,-31,-31 ;7        
        ROTVERTEX2 -31,+00,-31 ;8
        ROTVERTEX2 -31,+00,+00 ;9
        ROTVERTEX2 +31,-00,-31 ;10
        ROTVERTEX2 +31,-00,-00 ;11
	ld hl,polyarcaA
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyarcaA
	call drawfaces
	jp sortobjnext
	;display "   ROTARCAx64a size=",/D,$-ROTARCAx64a   
;-------------------------------------------------------------------        
; арка x32a      
;------------------------------------------------------------------- 
ROTARCAx32a
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 -15,+31,+08 ;0
        ROTVERTEX2 -15,+31,+31 ;1
        ROTVERTEX2 -15,-31,+16 ;2
        ROTVERTEX2 -15,-31,-31 ;3
        ROTVERTEX2 +15,+31,+08 ;4
        ROTVERTEX2 +15,+31,+31 ;5
        ROTVERTEX2 +15,-31,+16 ;6
        ROTVERTEX2 +15,-31,-31 ;7        
        ROTVERTEX2 -15,+00,-31 ;8
        ROTVERTEX2 -15,+00,+00 ;9
        ROTVERTEX2 +15,-00,-31 ;10
        ROTVERTEX2 +15,-00,-00 ;11
	ld hl,polyarcaA
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyarcaA
	call drawfaces
	jp sortobjnext
	;display "   ROTARCAx32a size=",/D,$-ROTARCAx32a     
;-------------------------------------------------------------------        
; арка x16a      
;------------------------------------------------------------------- 
ROTARCAx16a
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 -7,+31,+08 ;0
        ROTVERTEX2 -7,+31,+31 ;1
        ROTVERTEX2 -7,-31,+16 ;2
        ROTVERTEX2 -7,-31,-31 ;3
        ROTVERTEX2 +7,+31,+08 ;4
        ROTVERTEX2 +7,+31,+31 ;5
        ROTVERTEX2 +7,-31,+16 ;6
        ROTVERTEX2 +7,-31,-31 ;7        
        ROTVERTEX2 -7,+00,-31 ;8
        ROTVERTEX2 -7,+00,+00 ;9
        ROTVERTEX2 +7,-00,-31 ;10
        ROTVERTEX2 +7,-00,-00 ;11
	ld hl,polyarcaA
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polyarcaA
	call drawfaces
	jp sortobjnext
	;display "   ROTARCAx16a size=",/D,$-ROTARCAx16a  
;-------------------------------------------------------------------        
; треугольный столбик      
;------------------------------------------------------------------- 
sz=8
ROTTRI
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 -sz,+2*sz,-11 ;0
        ROTVERTEX2 -sz,+2*sz,+11 ;1
        ROTVERTEX2 -sz,-sz,+11   ;2
        ROTVERTEX2 -sz,-sz,-11   ;3
        ROTVERTEX2 +12,+2*sz,+00 ;4
        ROTVERTEX2 +12,-sz,-00   ;5
        ROTVERTEX2 -sz,+2*sz,-04 ;6
        ROTVERTEX2 -sz,+2*sz,+04 ;7
        ROTVERTEX2 -sz,-sz,+04   ;8
        ROTVERTEX2 -sz,-sz,-04   ;9
	ld hl,polytri
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polytri
	call drawfaces
	jp sortobjnext
	;display "   ROTTRI size=",/D,$-ROTTRI         


;-------------------------------------------------------------------        
; куб с Ротатором и Светом      
;------------------------------------------------------------------- 
sz=10
ROTCUBEFULL
	ROTATEBEGIN
                   ;X Z Y
        ROTVERTEX2 +sz,+sz,+sz ;0
        ROTVERTEX2 +sz,+sz,-sz ;1
        ROTVERTEX2 +sz,-sz,-sz ;2
        ROTVERTEX2 +sz,-sz,+sz ;3
        ROTVERTEX2 -sz,+sz,+sz ;4
        ROTVERTEX2 -sz,+sz,-sz ;5
        ROTVERTEX2 -sz,-sz,-sz ;6
        ROTVERTEX2 -sz,-sz,+sz ;7
	ld hl,polycubefull
	call checkvisibility ;11600t (4600t восьмибитное)
	ld hl,polycubefull
	call drawfaces
	jp sortobjnext
	;display "   ROTCUBEFULL size=",/D,$-ROTCUBEFULL 
;-------------------------------------------------------------------      
; пирамида вершиной ВВЕРХ
;------------------------------------------------------------------- 
ROTPYRAMIDUP
	ROTATEBEGIN
                  ;X Z Y
        ROTVERTEX2 +00,-31,+00
        ROTVERTEX2 +26,+15,-26
        ROTVERTEX2 +26,+15,+26
        ROTVERTEX2 -26,+15,+26
        ROTVERTEX2 -26,+15,-26
	ld hl,polypyramidup
	call checkvisibility
	ld hl,polypyramidup
	call drawfaces
	jp sortobjnext
	;display "   ROTPYRAMIDUP size=",/D,$-ROTPYRAMIDUP
;-------------------------------------------------------------------      
; пирамида вершиной ВНИЗ
;------------------------------------------------------------------- 
ROTPYRAMIDDN
	ROTATEBEGIN
                  ;X Z Y
        ROTVERTEX2 +00,+31,+00
        ROTVERTEX2 +24,-00,-24
        ROTVERTEX2 +24,-00,+24
        ROTVERTEX2 -24,-00,+24
        ROTVERTEX2 -24,-00,-24
	ld hl,polypyramiddn
	call checkvisibility
	ld hl,polypyramiddn
	call drawfaces
	jp sortobjnext
	;display "   ROTPYRAMIDDN size=",/D,$-ROTPYRAMIDDN



        

	display "---------- rotmodel vertex --- size ",/D,$-rotmodelbegin
