semi-transparent.surf

// by Maxim Leyenson color_file_format = jpg; double Pi=2*arccos(0); clear_screen; clear_pixmap; width=400; height=400; // ------------------- rotation // angle = r/100 * Pi // int r1 = 30; // int r2 = 20; // int r3 = 5; int r1 = 0; int r2 = 0; int r3 = 0; rot_x= r1/100 * Pi; rot_y= r2/100 * Pi; rot_z= r3/100 * Pi; // -------- scaling double R = 2; // -R -- +R double sf = R/10; scale_x= sf; scale_y= sf; scale_z= sf; // ----------------- surface poly s = z^3 - x * z - y; surface = s; // ---- transparency module, copied from the // Surf manual --------------------------- spec_z = 25.0; perspective=central; transparence=60; transmitted =70; thickness =14; surface_red =255; surface_green=100; surface_blue =130; inside_red =255; inside_green =100; inside_blue =130; //-- light illumination=ambient_light+ diffuse_light+ reflected_light+ transmitted_light; ambient=20; smoothness=30; light1_x=1-00; light1_y=100; light1_z=100; light1_vol=80; light3_x=100; light3_y=20; light3_z=50; light3_vol=60; light8_x=-100; light8_y=100; light8_z=-100; light8_vol=0; // ------------------------------------- int N = 100; // draw this number of pictures int i=0; loop: surface=rotate(s,2*Pi/N * i,xAxis); // rotate the cubic; 1 small rotation = 2pi/N // -- should rotate around the x axes!! clear_screen; draw_surface; // draw the cubic filename="/library/a"+itostrn(3,i)+".jpg"; save_color_image; // save the image i=i+1; if( i < N ) goto loop; // ------------------------------------