11.17 Sample ‘boxs

Function boxs draw surface by boxes. You can use ‘#’ for drawing wire plot.

MGL code:

call 'prepare2d'
origin 0 0 0
subplot 2 2 0:title 'Boxs plot (default)':rotate 40 60:light on:box:boxs a
subplot 2 2 1:title '"\@" style':rotate 50 60:box:boxs a '@'
subplot 2 2 2:title '"\#" style':rotate 50 60:box:boxs a '#'
subplot 2 2 3:title 'compare with Tile':rotate 50 60:box:tile a

C++ code:

void smgl_boxs(mglGraph *gr)
{
	mglData a;	mgls_prepare2d(&a);
	gr->SetOrigin(0,0,0);	gr->Light(true);
	if(big!=3)	{gr->SubPlot(2,2,0);	gr->Title("Boxs plot (default)");}
	gr->Rotate(40,60);	gr->Box();	gr->Boxs(a);
	if(big==3)	return;
	gr->SubPlot(2,2,1);	gr->Title("'\\@' style");
	gr->Rotate(50,60);	gr->Box();	gr->Boxs(a,"@");
	gr->SubPlot(2,2,2);	gr->Title("'\\#' style");
	gr->Rotate(50,60);	gr->Box();	gr->Boxs(a,"#");
	gr->SubPlot(2,2,3);	gr->Title("compare with Tile");
	gr->Rotate(50,60);	gr->Box();	gr->Tile(a);
}
Sample boxs