function animate(var i){ group select,"dynamic"; // we need to clear whole group each frame group clear; // create surfaces and blends blend tot,total; surface def,default; surface met,metalic; // add geometry var j=0; var maxb=33*5; while(j0){ objectadd sphere,pos,r,def,tot; }; if (r<0){ objectadd sphere,pos,-r,met,tot; }; j=j+1; }; var j=0; while(j>0){ var r=1; objectadd sphere,(0,0,0),r,met,tot; j=j-1; }; // some moving light lightAdd point,(-4,-5+sin(i/10)*10,-20),(0.4,0.6,0.9); // animated background //background sky,(sin(i/10+13),cos(i/14+53),sin(i/16+66),0)/4+(0.3,0.3,0.3,0.99),(sin(i/40+64),cos(i/24+34),sin(i/36+64),0)/2+(0.5,0.5,0.5,0.93),(0.1,0,0,1),(0,1,0); } function camsetup(){ camera perspective,(600,500)*scale,600*scale,(0,0,-15); //camera sphere,600,600/2,(0,0,5),<>; //camera fisheye,600/2,600/2,(0,0,5),<>; //camera stereo,1200,400,400,(0,0,-10),<>,1,8; } function staticsetup(){ group select,"static"; sett recurse,100; lightAdd point,(6,2,-15),(0.5,0.3,0.1); lightAdd ambient (0.1,0.2,0.4)/4; background sky,(0,1,0),(0.2,0.4,0.6,0.7),(0,0,0,0.5),(0.6,0.7,0.8,0.2); shaderNode tm,toneMap,gamma,2,1; sett tonemapping,ray,tm; blend tot,total; surface def,default; surface met,metalic; surface gla,glass2,1.1; //objectadd sphere,(-2,2,-5),2,gla,tot; //objectadd cone,(-2,2,-5)@<34,54,65>*(2/2,3/2,5),gla,tot; //objectadd paraboloid,(-2,2,-5)@<34,54,65>*(3/2,0.4/2,5),gla,tot; objectadd ellipsoid,(-2,2,-5)@<344,343,433>*(2,1,4),gla,tot; } function rendertoview(){ view select,"render"; camsetup(); sett imagesampler totalrotuniform,5; sett pixelorder worm; sett pixelfilter mitchell; render; } function animloop(var imax){ var starttime=clock(); var c=0; while(c; for help on commands"; echo "info(); displays this text"; echo "animate(); moves object on scene"; echo "animloop(); shows animation"; echo "showinfo all; displays scene information"; echo "flayer; starts fly scene mode"; echo "pv raytrace,1,0; turns on transparent alpha preview"; echo "pv setdelay,1/5; sets preview delay, more delay==better quality,less fps"; echo "render; renders current scene (traditional way)"; echo "rendertoview(); opens new view and renders scene with AA"; echo "threads 0; clears whole scene"; echo "exit; to end interactive mode"; echo ""; echo "you can try 'view size,(800,600)', 'background color,(0.3,0.2,0.1,0.5)'"; echo "'camera envmap,(600,600/2),(0,0,5),<>'"; echo "adding/removing objects/lights etc..."; echo ""; echo "you can also play with new script parser. examples:"; echo "echo normalize((1,0,0)+(0,1,0)); vector operations"; echo "echo 'string test 2+2='+(2+2); string operations"; echo "echo <10,0,0>*<0,10,0>; matrices"; echo "echo <10,0,0>.x; vector from matrix"; echo ""; } about; staticsetup(); var scale,1; animate(0); previewsetup(); info(); //animloop(100); //flayer 0,2,0.05; render; interactive;