11.30 Sample ‘contf_xyz

Functions contfz, contfy, contfx, draw filled contours on plane perpendicular to corresponding axis. One of possible application is drawing projections of 3D field.

MGL code:

call 'prepare3d'
title 'ContF[XYZ] sample':rotate 50 60:box
contfx {sum c 'x'} '' -1:contfy {sum c 'y'} '' 1:contfz {sum c 'z'} '' -1

C++ code:

void smgl_contf_xyz(mglGraph *gr)
{
	mglData c;	mgls_prepare3d(&c);
	if(big!=3)	gr->Title("ContF[XYZ] sample");
	gr->Rotate(50,60);	gr->Box();	gr->ContFX(c.Sum("x"),"",-1);
	gr->ContFY(c.Sum("y"),"",1);	gr->ContFZ(c.Sum("z"),"",-1);
}
Sample contf_xyz