11.60 Sample ‘fog

Example of fog.

MGL code:

call 'prepare2d'
title 'Fog sample':rotate 50 60:light on:fog 1
box:surf a:cont a 'y'

C++ code:

void smgl_fog(mglGraph *gr)
{
	mglData a;	mgls_prepare2d(&a);
	if(big!=3)	gr->Title("Fog sample");
	gr->Light(true);	gr->Rotate(50,60);	gr->Fog(1);	gr->Box();
	gr->Surf(a);	gr->Cont(a,"y");
}
Sample fog