//adapted 4/05 #include "colors.inc" #include "metals.inc" #include "finish.inc" #include "math.inc" #include "automobile_bug.inc" #include "mrg_misc2.inc" global_settings { max_trace_level 10 ambient_light rgb<1, 1, 1> } //light_source { <4,4, -5> color White} light_source { <0,+40, -50>*10 color rgb <1,.8,.6>} #declare lclock=clock+0.0; #declare crot=10+77*trans((lclock-1)/.5)-87*trans((lclock-2.5)/.5)+10*trans((lclock-4)/.5); #declare cscale=10; #declare cpos= vrotate(<0, 0 ,-80*cscale>,x*crot)+2.5*y; camera { location cpos look_at <0,1,0> angle 34/cscale } #declare dangle=-lclock*360; #declare rangle=lclock*2*pi; #declare courserad=16; #declare coursewidth=5; #declare xnow=-courserad*cos(rangle); #declare znow=-courserad*sin(rangle); #declare bangle = 0.01; #declare brangle = bangle*pi/180; #declare h=coursewidth*tan(brangle); //arrow #declare arrow=merge{ cylinder{<0,0,0>,<.6,0,0>,.05} cone { <.6, 0, 0>, .2, <1, 0, 0>, .0000001 } } //car location #declare centerbug= vrotate(y*h/2-x*(courserad),y*dangle); //vectors #declare vscale=10; #declare wvec=-y*vscale; //everything else is determined relative to weight #declare Nvec=-wvec; #declare Fvec=vrotate(.6*vscale*x,y*dangle); #declare post = .15; #declare head=6*post; #declare hddm=3*post; object{ Make_Vector(Nvec,head,post,hddm) pigment{ color rgb <.2,1,.2> } finish { phong 0 phong_size 20 ambient 1.2 diffuse 0} no_shadow no_reflection translate centerbug } #declare Nlabel=text { ttf "timrom.ttf" "N" .005, 0 scale 2.2 pigment{ color rgb <.2,1,.2> } finish { phong .0 phong_size 20 ambient 1.2 } no_shadow no_reflection }; #declare NLpos= centerbug+Nvec+.2*y; object{orient_object(Nlabel,NLpos,cpos)} object{ Make_Vector(Fvec,head,post,hddm) pigment{ color Orange } finish { ambient 1 diffuse 0} no_shadow no_reflection translate centerbug } #declare Flabel=text { ttf "georgiai.ttf" "f" .005, 0 scale 2.2 pigment{ color Orange } finish { ambient 1 diffuse 0} no_shadow no_reflection }; #declare FLpos= centerbug+Fvec*1.1; object{orient_object(Flabel,FLpos,cpos)} object{ Make_Vector(wvec,head,post,hddm) pigment{ color Yellow } finish { ambient 1.5 diffuse 0} no_shadow no_reflection translate centerbug } #declare wlabel=text { ttf "Times" "w" .005, 0 scale 2.2 pigment{ color Yellow } finish { ambient 1 diffuse 0 } no_shadow no_reflection }; #declare wLpos= centerbug+wvec*1.15; object{orient_object(wlabel,wLpos,cpos)} object{automobile_bug scale 2 rotate -z*bangle //orient for track translate y*h/2-x*courserad //place on track rotate y*dangle //move around track } //normal sky_sphere { pigment { gradient y color_map { [0.000 0.002 color rgb <1.0, 1, 0.8> color rgb <1.0, 1, 0.8>] [0.002 0.200 color rgb <0.8, 0.8, 0.6> color rgb <0.2, 0.2, 0.8>] } scale 2 translate -1 } pigment { bozo turbulence 0.65 octaves 6 omega 0.7 lambda 2 color_map { [0.0 0.1 color rgb <0.85, 0.85, 0.85> color rgb <0.75, 0.75, 0.75>] [0.1 0.5 color rgb <0.75, 0.75, 0.75> color rgbt <1, 1, 1, 1>] [0.5 1.0 color rgbt <1, 1, 1, 1> color rgbt <1, 1, 1, 1>] } scale <0.2, 0.5, 0.2>/cscale } rotate -105*x rotate y*180 } plane { //ground plane y, -.01 texture { pigment { color rgbt <.9,.7,.5,.75> } normal { bumps .6 scale 2.5 } finish { phong .1 phong_size 1500 ambient .8 diffuse .4} } } plane { //no sky color leak through ground plane y, -24 texture { pigment { color rgb <.9,.7,.5>*.5 } finish {ambient 1 diffuse 0} } } //track difference{ cylinder { <0, 0, 0>, <0, h, 0>, courserad+coursewidth/2 } cylinder { <0, -.001, 0>, <0, h+2, 0>, courserad-coursewidth/2 } texture { pigment { color rgbt <.3,.3,.3,.6> } //normal { bumps 0.25 scale 0.125 } finish { phong .4 phong_size 50 ambient .6 diffuse .0} } }