/*------------------------------------------------------------------------------*
 *	File Name: 	3D.ogs		   													*
 *	Purpose:	3D Rotation Tools												*
 *	Author:		George John 8/19/98												*
 *	Modifications:																*			*
 *																				*
 *------------------------------------------------------------------------------*/


 [Init]
	if (layer.Is3D != 1)
	{
		type -b;
		return 1;
	}

	if ( RotAngle3D < 0 || RotAngle3D > 360 )
		RotAngle3D = 10;

	//;layer -3D M dialog;
	return 0;

[End]
	plot -Page

[OneToSix]

	if (run.section(,Init))
		return 1;

	//type -b "$(%1)";

	x = RotAngle3D;
	if(x < 0 || x > 360)
		x=20;

	i=int((1 + %1)/2);

	if(layer.3dcoor==1)
		%B="Z H V";
	else
		%B="Y H V";

	%A=%[%B,#i];
	//RotAngle.value=x;
	x *= mod(%1,2)==1?-1:1;
	if(layer.3dcoor==0 && i==1)
		x*=-1;/* we had a wrong convention for this */

	layer -3D R %A x;

	run.section(,End);

 [Per3Plus]
	if (run.section(,Init))
		return 1;
	layer -3d m P+1;
	run.section(,End);

 [Per3Minus]
	if (run.section(,Init))
		return 1;
	layer -3d m P-1;
	run.section(,End);

 [RotRestore]
	if (run.section(,Init))
		return 1;
	layer -3d m Rotation;
	//run.section(,End);
	x1=x1;// force axes redraw

 [FitFrame]
	if (run.section(,Init))
		return 1;
	layer -3d m F;
	run.section(,End);





