

		include "offsetsd3.i"
		include	"baselibs.i"
		include	"d3Libs.i"
		include	"baselibs1.i"

	#define	LF,10
		
		variables

		int	xv,yv,zv,wv

		int	xsint,xcost,ysint,ycost,
		
		int	loop1,loop2

		int	aradius,bradius
		int	error
		int	key
	main()
	{
		func	error,=,OpenD3
		if	error,==,0,1
		{
		print	<"no open d3.library",LF>
		exit	0
		}
		ifend	1	
		
		OpenD3Screen			;openlibs

		func	error,=,OpenD3Window,0,0,310,240,1
		
		if	error,!=,0,2
		{
		LightArcus	$0400,$fa00

		ColorSet	$0f60,$0def

		D3Rot		$2d00,$2400,$0600

		D3Dist		$4000		;distans

		AllocD3Buf	1
		
		TestZero	d0,error

		calc	aradius,=,$0480
		calc	loop1,=,0

		while	loop1,«,$2000,1
		{
		calc	loop1,=,loop1,+,32
		calc	loop2,=,0
		
			while	loop2,«,$4000,2
			{
			calc	loop2,=,loop2,+,24

			calc	bradius,=,aradius,*,sin,loop1
			calc	xv,=,bradius,*,sin,loop2
			calc	yv,=,bradius,*,cos,loop2
			calc	zv,=,aradius,*,cos,loop1
			calc	xv,=,xv,*,cos,loop1
			calc	zv,=,zv,*,sin,xv
			calc	zv,=,zv,*,6
			calc	yv,=,yv,>>,1

			D3ColorPlot	xv,yv,zv
	
			}	2
		
			func	key,=,TestVanillaKey
			if	key,!=,0,3
			{
			calc	loop1,=,$2000
			}
			ifend	3
		}	1
				
		ColorWindow	1
		}
		ifend	2
		FreeD3Buf	1
		
		ClickD3Window	1
	
		CloseD3Screen			;closelibs
cleanup		CloseD3

	}	

		end	
