manpagez: man pages & more
info mathgl
Home | html | info | man
[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

9.7.7 Sew sample

../png/sew

C++ code

mglData a(100, 100);
a.Modify("mod((y^2-(1-x)^2)/2,0.1)");
gr->Rotate(40, 60);
gr->Light(true);
gr->Alpha(true);
gr->Surf(a, "b");
a.Sew("xy", 0.1);
gr->Surf(a, "r");
gr->Box();

MGL code

new a 100 100
modify a 'mod((y^2-(1-x)^2)/2,0.1)'
rotate 40 60
light on
alpha on
surf a 'b'
sew a 'xy' 0.1
surf a 'r'
box

Pure C code

HMDT a = mgl_create_data_size(100,100,1);
mgl_data_modify(a, "mod((y^2-(1-x)^2)/2, 0.1)", 0);
mgl_rotate(gr,40.,60.,0.);
mgl_set_light(gr,1);
mgl_set_alpha(gr,1);
mgl_surf(gr,a,"b");
mgl_data_sew(a,"xy",0.1);
mgl_surf(gr,a,"r");
mgl_box(gr,1);

Fortran code

integer a, mgl_create_data_size
a = mgl_create_data_size(100,100,1)
call mgl_data_modify(a, 'mod((y^2-(1-x)^2)/2, 0.1)', 0)
call mgl_rotate(gr,40.,60.,0.)
call mgl_set_light(gr,1)
call mgl_set_alpha(gr,1)
call mgl_surf(gr,a,'b')
call mgl_data_sew(a,'xy',0.1)
call mgl_surf(gr,a,'r')
call mgl_box(gr,1)

Python

a = mglData(100, 100);
a.Modify("mod((y^2-(1-x)^2)/2, 0.1)");
gr.Rotate(40, 60);  gr.Light(True);     gr.Alpha(True);
gr.Surf(a, "b");
a.Sew("xy", 0.1);
gr.Surf(a, "r");
gr.Box();

© manpagez.com 2000-2024
Individual documents may contain additional copyright information.