| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
9.7.15 Stereo image sample
C++ code
mglData a(50,40);
a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))");
gr->Light(true);
gr->SubPlot(2,1,0);
gr->Rotate(40,60+3);
gr->Box(); gr->Surf(a);
gr->SubPlot(2,1,1);
gr->Rotate(40,60-3);
gr->Box(); gr->Surf(a);
MGL code
new a 50 40 modify a '0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))' light on subplot 2 1 0 rotate 40 60+3 box:surf a subplot 2 1 1 rotate 40 60-3 box:surf a
Pure C code
HMDT a = mgl_create_data_size(50,40,1); mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); mgl_set_light(gr,1); mgl_subplot(gr,2,1,0); mgl_rotate(gr,40.,60.+3.,0.); mgl_box(gr,1); mgl_surf(gr,a,0); mgl_subplot(gr,2,1,1); mgl_rotate(gr,40.,60.-3.,0.); mgl_box(gr,1); mgl_surf(gr,a,0); mgl_delete_data(a);
Fortran code
integer a, mgl_create_data_size a = mgl_create_data_size(50,40,1); call mgl_data_modify(a,"0.6*sin(2*pi*x)*sin(3*pi*y) + 0.4*cos(3*pi*(x*y))",0); call mgl_set_light(gr,1) call mgl_subplot(gr,2,1,0) call mgl_rotate(gr,40.,60.+3.,0.) call mgl_box(gr,1) call mgl_surf(gr,a,'') call mgl_subplot(gr,2,1,1) call mgl_rotate(gr,40.,60.-3.,0.) call mgl_box(gr,1) call mgl_surf(gr,a,'') call mgl_delete_data(a)
Python
a = mglData(50,40);
a.Modify("0.6*sin(2*pi*x)*sin(3*pi*y)+0.4*cos(3*pi*(x*y))");
gr.Light(True);
gr.SubPlot(2,1,0);
gr.Rotate(40,60+3);
gr.Surf(a); gr.Box();
gr.SubPlot(2,1,1);
gr.Rotate(40,60-3);
gr.Surf(a); gr.Box();
