Next: Tile sample, Previous: Belt sample, Up: 2D samples [Contents][Index]
Function boxs draw surface by boxes. You can use ‘#’ for drawing wire plot. The sample code is:
int sample(mglGraph *gr)
{
mglData a; mgls_prepare2d(&a);
gr->SetOrigin(0,0,0); gr->Light(true);
gr->SubPlot(2,2,0); gr->Title("Boxs plot (default)");
gr->Rotate(40,60); gr->Box(); gr->Boxs(a);
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);
return 0;
}