
		include "offsetsd3.i"
		include	"baselibs.i"
		include	"baselibs1.i"
		include	"d3Libs.i"
		
	#define	LF,10

		variables

		int	xv,yv,zv,wv

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

		int	aradius,bradius
		int	error
		char	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
			{
			print	<"no open D3Window",LF>
			closeD3
			exit	0
			}
			ifend	2	
	
		
		LightArcus	$0400,$fa00

		ColorSet	$0f60,$0def

		D3Rot		$2400,$1400,$0600

		D3Dist		$4000		;distans

		AllocD3Buf	1
		
		TestZero	d0,error

		calc	aradius,=,$0400
		calc	loop1,=,0

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

			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,yv
			calc	zv,=,zv,*,4
			calc	yv,=,yv,*,2

			D3ColorPlot	xv,yv,zv
	
			}	2
		
		func	key,=,testVanillaKey
		if	key,!=,0,3
			{
			calc	loop1,=$2000
			}
			ifend	3
		}	1
				
		ColorWindow	1

		FreeD3Buf	1
		
		ClickD3Window	1
	
		CloseD3Screen			;closelibs
		CloseD3

	}	

		end	
