#include "automobile_bug.inc" #include "kinematic_path2" #include "mrg_misc2" /* run .ini Antialias=on Antialias_Threshold=0.2 Antialias_Depth=3 Input_File_Name=car_kinematics_2D.pov Output_File_Name=car_kinematics_2D Initial_Frame=1 Final_Frame=280 Initial_Clock=.01 Final_Clock=1 Cyclic_Animation=off Pause_when_Done=off +FC */ global_settings { assumed_gamma 1.0 ambient_light .5 } #declare lclock=clock+.8; //watch out for funny things with aceleration vector at t=0 #declare spclock=lclock*16; #declare dt=.001; /* #declare sp_pos=kinematic_path(spclock); #declare sp_vel=(kinematic_path(spclock+dt)-kinematic_path(spclock))/dt; #declare sp_acc=(kinematic_path(spclock+dt)-2*kinematic_path(spclock)+kinematic_path(spclock-dt))/(dt*dt); */ #declare sp_pos=kine_pos(spclock); #declare sp_vel=kine_vel(spclock); #declare sp_acc=kine_acc(spclock); #declare u_v=sp_vel/vlength(sp_vel); #declare u_vp=vcross(u_v,y); object{automobile_bug scale 1 rotate y*180 rotate y*180/pi*atan2(u_v.x,u_v.z) translate sp_pos } #declare cpos=; camera { location cpos look_at sp_pos angle 28 } #declare vec_post_diam = .025; #declare vec_head_diam = 3*vec_post_diam; #declare vec_head_len=9*vec_post_diam; #declare dsp_vel=sp_vel/5; #declare dsp_acc=sp_acc/5; #if(vlength(sp_vel)>=2) object{ Make_Vector(dsp_vel,vec_head_len,vec_post_diam,vec_head_diam) texture { pigment { // (---surface color---) color rgb <.0,.0,.7> } finish { // (---surface finish---) ambient 1.0 specular 0.1 } } no_shadow no_reflection translate sp_pos+1.55*y+u_vp*.1 } #declare tpos=sp_pos+dsp_vel+.2*dsp_vel/vlength(dsp_vel)+1.55*y+u_vp*.1; object{ orient_text(tpos,cpos,"v",.6) texture { pigment { // (---surface color---) color rgb <.0,0,.7> } finish { // (---surface finish---) ambient 1.0 specular 0.1 } } no_shadow no_reflection } #end #if(vlength(sp_acc)>=3) object{ Make_Vector(dsp_acc,vec_head_len,vec_post_diam,vec_head_diam) texture { pigment { // (---surface color---) color rgb <.0,.7,.0> } finish { // (---surface finish---) ambient 1.0 specular 0.1 } } no_shadow no_reflection translate sp_pos+1.55*y-u_vp*.1 } #declare tpos=sp_pos+dsp_acc+.2*dsp_acc/vlength(dsp_acc)+1.55*y-u_vp*.1; object{ orient_text(tpos,cpos,"a",.5) texture { pigment { // (---surface color---) color rgb <.0,.6,.0> } finish { // (---surface finish---) ambient 1.0 specular 0.1 } } no_shadow no_reflection } #end plane { //graph paper of cosmic scale y, -.001 texture { pigment{ brick color Black, // color of mortar color Gray // color of brick brick_size 5*<1,1,1> // size of brick (optional) mortar .4 // width of mortar (optional) translate y*.4 } finish{ambient 1 diffuse 1} } } #declare dpt=.005; #declare ctr = 0; union{ #while (ctr <= lclock) #declare this=ctr*16; cylinder { //kinematic_path(this), kinematic_path(this+14*dpt),.15 kine_pos(this), kine_pos(this+16*dpt),.15 hollow} #declare ctr = ctr + dpt; #end pigment { rgbt <.2,.2,.9,.4> } finish{ambient .5 specular .5 diffuse .5} } //object{automobile_bug scale 5 rotate y*180} // An area light (creates soft shadows) // WARNING: This special light can significantly slow down rendering times! light_source { 0*x // light's position (translated below) color rgb .3 // light's color area_light <8, 0, 0> <0, 0, 8> // lights spread out across this distance (x * z) 4, 4 // total number of lights in grid (4x*4z = 16 lights) adaptive 0 // 0,1,2,3... circular // make the shape of the light circular orient // orient light translate <-10, 80, -40> // position of light }