[ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.5.3 3D plot sample
C++ code
gr->Alpha(true); gr->Light(true); gr->Light(0,mglPoint(0,0,1)); mglData a(30,30,30), b(30,30,30); a.Modify("exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))"); b.Modify("16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)"); gr->CAxis(0,1); gr->SubPlot(2,2,0); gr->Rotate(40,60); gr->Surf3(a,"wgk"); gr->Box(); gr->SubPlot(2,2,1); gr->Rotate(40,60); gr->DensA(a); gr->Box(); gr->Axis(); gr->SubPlot(2,2,2); gr->Rotate(40,60); gr->Cloud(a); gr->Box(); gr->SubPlot(2,2,3); gr->Rotate(40,60); gr->Surf3A(b,a,"q"); gr->Box();
MGL code
alpha on: light on light 0 0 0 1 new a 30 30 30: new b 30 30 30 modify a 'exp(-16*((z-0.5)^2+(y-0.5)^2)/(1+4*x^2))' modify b '16*((z-0.5)^2+(y-0.5)^2)*(x)/(1+4*x^2)' caxis 0 1 subplot 2 2 0: rotate 40 60 surf3 a 'wgk': box subplot 2 2 1: rotate 40 60 densa a: box: axis subplot 2 2 2: rotate 40 60 cloud a: box subplot 2 2 3: rotate 40 60 surf3a b a 'q': box