#include "automobile_bug.inc" #include "fastcar.inc" #include "mrg_misc3.inc" global_settings { assumed_gamma 1.0 ambient_light .5 } background{color rgb .4} #declare lclock=clock+0; #declare cscale = 5; #declare cpos =<0.0, 10.0, -25.0>*1.4*cscale; camera { location cpos look_at <0.0, -12, 0.0> right x*image_width/image_height angle 67/cscale } // create a regular point light source light_source { 0*x // light's position (translated below) color rgb <1,1,1> // light's color translate <-20, 40, -20>*3 } box { <-30, -.1, -3>, <30, 0, 3> pigment{color rgb .9} finish{ambient .5 diffuse .5} } //KINEMATICS t is lclock and goes from 0 to 1, // rescalling of time with fps #declare x3f=40; //desired total distance #declare btw=function(xx,xlow,xhigh){min(max(xx,xlow),xhigh)} //returns xx or boundary #declare vel = function(tt) { x3f } #declare pos = function(tt) { x3f*tt} #declare aa=function(tt){0} #declare lth=.07; union{ //position plot #declare pt=0; #declare dpt=.01; #declare vscale = .1; #declare hscale=15; #declare this=; union{ #while(pt; cylinder{this, next,lth pigment{color rgb <1,0,0>}finish{ambient 2}} #declare this=next; #declare pt=pt+dpt; #end cylinder{-.5*x,(hscale+.5)*x,lth pigment{color rgb 0}} cylinder{-.5*y,4.5*y,lth pigment{color rgb 0}} text { ttf "arial.ttf","x",.02, 0 scale 1.8 translate .25*x+3.5*y } text { ttf "arial.ttf","t",.02, 0 scale 1.8 translate (hscale+.5)*x-.75*y } box{-x-y+.1*z,(hscale+1.5)*x+5*y+.05*z pigment{color rgb 1} finish{ambient 2}} translate 8*y } //velocity plot #declare pt=0; #declare dpt=.01; #declare vscale = .05; #declare this=; union{ #while(pt; cylinder{this, next,lth pigment{color rgb <1,0,0>}finish{ambient 2}} #declare this=next; #declare pt=pt+dpt; #end cylinder{-.5*x,(hscale+.5)*x,lth pigment{color rgb 0}} cylinder{-.5*y,4.5*y,lth pigment{color rgb 0}} text { ttf "arial.ttf","v",.02, 0 scale 1.8 translate .25*x+3.5*y } text { ttf "arial.ttf","t",.02, 0 scale 1.8 translate (hscale+.5)*x-.75*y } box{-x-y+.1*z,(hscale+1.5)*x+5*y+.05*z pigment{color rgb 1} finish{ambient 2}} } //acceleration plot #declare pt=0; #declare dpt=.0025; #declare vscale = .03; #declare this=; union{ #while(pt; cylinder{this, next,lth pigment{color rgb <1,0,0>}finish{ambient 2}} #declare this=next; #declare pt=pt+dpt; #end cylinder{-.5*x,(hscale+.5)*x,lth pigment{color rgb 0}} cylinder{-.5*y,4.5*y,lth pigment{color rgb 0}} text { ttf "arial.ttf","a",.02, 0 scale 1.8 translate .25*x+3.5*y } text { ttf "arial.ttf","t",.02, 0 scale 1.8 translate (hscale+.5)*x-.75*y } box{-x-y+.1*z,(hscale+1.5)*x+5*y+.05*z pigment{color rgb 1} finish{ambient 2}} translate -8*y } rotate 25*x translate -20*y-20*x } #declare xc0=-20; object{automobile_bug scale 1 rotate -y*90 translate (xc0+pos(lclock))*x-2*z } #declare tmark=0; #while(tmark translate (xc0+pos(tmark))*x-2.3*z pigment{color rgb <.4,0,0>} finish{phong 20} } #declare tmark=tmark+.05; #end #declare aaf=2*x3f; #declare vel2 = function(tt) { aaf*tt } #declare pos2 = function(tt) { .5*aaf*max(tt,0)*max(tt,0)} //dont start till t=0 #declare aa2=function(tt){aaf} union{ //position plot #declare pt=0; #declare dpt=.01; #declare vscale = .1; #declare hscale=15; #declare this=; union{ #while(pt; cylinder{this, next,lth pigment{color rgb <0,0,1>}finish{ambient 2}} #declare this=next; #declare pt=pt+dpt; #end cylinder{-.5*x,(hscale+.5)*x,lth pigment{color rgb 0}} cylinder{-.5*y,4.5*y,lth pigment{color rgb 0}} text { ttf "arial.ttf","x",.02, 0 scale 1.8 translate .25*x+3.5*y } text { ttf "arial.ttf","t",.02, 0 scale 1.8 translate (hscale+.5)*x-.75*y } box{-x-y+.1*z,(hscale+1.5)*x+5*y+.05*z pigment{color rgb 1} finish{ambient 2}} translate 8*y } //velocity plot #declare pt=0; #declare dpt=.01; #declare vscale = .05; #declare this=; union{ #while(pt; cylinder{this, next,lth pigment{color rgb <0,0,1>}finish{ambient 2}} #declare this=next; #declare pt=pt+dpt; #end cylinder{-.5*x,(hscale+.5)*x,lth pigment{color rgb 0}} cylinder{-.5*y,4.5*y,lth pigment{color rgb 0}} text { ttf "arial.ttf","v",.02, 0 scale 1.8 translate .25*x+3.5*y } text { ttf "arial.ttf","t",.02, 0 scale 1.8 translate (hscale+.5)*x-.75*y } box{-x-y+.1*z,(hscale+1.5)*x+5*y+.05*z pigment{color rgb 1} finish{ambient 2}} } //acceleration plot #declare pt=0; #declare dpt=.0025; #declare vscale = .03; #declare this=; union{ #while(pt; cylinder{this, next,lth pigment{color rgb <0,0,1>}finish{ambient 2}} #declare this=next; #declare pt=pt+dpt; #end cylinder{-.5*x,(hscale+.5)*x,lth pigment{color rgb 0}} cylinder{-.5*y,4.5*y,lth pigment{color rgb 0}} text { ttf "arial.ttf","a",.02, 0 scale 1.8 translate .25*x+3.5*y } text { ttf "arial.ttf","t",.02, 0 scale 1.8 translate (hscale+.5)*x-.75*y } box{-x-y+.1*z,(hscale+1.5)*x+5*y+.05*z pigment{color rgb 1} finish{ambient 2}} translate -8*y } rotate 25*x translate -20*y+5*x } object{fastcar scale 1 translate (xc0+pos2(lclock))*x+2*z } #declare tmark=0; #while(tmark translate (xc0+pos2(tmark))*x+1.7*z pigment{color rgb <0,0,.4>} finish{phong 20} } #declare tmark=tmark+.05; #end