#version 3.7; #declare CameraOnTrack = no; // fp view from the package point #declare WatchTrack = 0; #declare ShowWatchTrackOnly = no; #declare CameraFollowSpeed = 0.75; #declare CenterOfMass = yes; #declare COMF = 50; #declare StartLookAt = <0, 80, 0>; #declare CenterOfMassLookAt = <0, 80, 0>; #declare CFS = array[COMF]; // Center Of Mass calculations #declare LookAt = <500, 100, 0>; #macro WriteCOMFile() #fopen filehandle "data.inc" write #for(Count, 0, COMF-1, 1) #ifdef(CFS[Count]) #write(filehandle, "#declare CFS[",str(Count,0,0),"] = <", vstr(3, CFS[Count], ", ", -1,-1),">;\n") #else #write(filehandle, "#declare CFS[",str(Count,0,0),"] = <", vstr(3, StartLookAt, ", ", -1,-1),">;\n") #end #end #fclose filehandle #end #macro InitCenterOfMass() #for(Count,0, COMF-1, 1) #declare CFS[Count] = StartLookAt; #end WriteCOMFile() #end #macro ParseCenterOfMass(NewCenter) #declare ERROR = false; #include "data.inc" #local Count = COMF-1; #while (Count>0) #declare CFS[Count] = CFS[Count-1]; #local Count = Count - 1; #end #declare CFS[0] = NewCenter; WriteCOMFile() #local COMLookAt = <0, 0, 0>; #declare Count = 0; #while(Count] [1.0 rgb 1] } scale .175 }} light_source{ 0 color rgb 1.00 translate <-5, 50, -5 >*1000} light_source{ 0 color rgb 0.15 translate <-5, 50, 5 >*1000 shadowless} light_source{ 0 color rgb 0.15 translate < 5, 50, -5 >*1000 shadowless} light_source{ 0 color rgb 0.15 translate < 5, 50, 5 >*1000 shadowless} plane { y , 0 texture { pigment { checker pigment{rgb 0.25}, pigment{rgb 0.5} scale 100}}} #declare CameraLocation = < 900, 800,-2900>; #declare Direction = 1; sphere{0, 100 pigment { rgbt <1, 1, 0, 0.5>} translate <0, 100, 0> rotate y * frame_number/2} #for(Count, 0, frame_number-1,1) #declare Loc1 = vrotate(<40, 100, 0>, <0, Count * 16.5161, 0>); #declare Loc1 = Loc1 + <1500, 0, 0>; #declare Loc1 = vrotate(Loc1, <0, Count, 0>); // sphere{0, 5 pigment { rgb <0, 1, 0>} translate Loc1} #declare Loc2 = vrotate(<-120, 100, 0>, <0, Count * 8.4696329, 0>); #declare Loc2 = Loc2 + <-1600, 0, 0>; #declare Loc2 = vrotate(Loc2, <0, Count * 0.564666668998164, 0>); #declare Loc2 = Loc2 + <0, 0, 1000>; // sphere{0, 5 pigment { rgb <1, 0, 0>} translate Loc2} #declare Loc3 = vrotate(<-50, 100, 0>, <0, Count * 12.154224554, 0>); #declare Loc3 = Loc3 + <-1400, 0, 0>; #declare Loc3 = vrotate(Loc3, <0, Count * 1.2555166, 0>); // sphere{0, 5 pigment { rgb <0, 0, 1>} translate Loc3} #declare Loc4 = vrotate(<-50, 100, 0>, <0, Count * 19.9, 0>); #declare Loc4 = Loc4 + < 2000, 0, 0>; #declare Loc4 = vrotate(Loc4, <0, Count * .75545876456, 0>); #declare Loc4 = Loc4 + < 500, 0, 0>; // sphere{0, 5 pigment { rgb <1, 1, 0>} translate Loc4} #declare Loc5 = vrotate(<-30, 100, 0>, <0, Count * 30.5161689, 0>); #declare Loc5 = Loc5 + <1000, 0, 0>; #declare Loc5 = vrotate(Loc5, <0, Count * 2.546464616, 0>); // sphere{0, 5 pigment { rgb <0, 1, 1>} translate Loc5} #declare LookAt = (Loc1 + Loc2 + Loc3 + Loc4 + Loc5)/5; sphere{0, 5 pigment { rgb <1, 0, 1>} translate LookAt} #end #declare Loc1 = vrotate(<40, 100, 0>, <0, Count * 16.5161, 0>); #declare Loc1 = Loc1 + <1500, 0, 0>; #declare Loc1 = vrotate(Loc1, <0, Count, 0>); #declare Loc2 = vrotate(<-120, 100, 0>, <0, Count * 8.4696329, 0>); #declare Loc2 = Loc2 + <-1600, 0, 0>; #declare Loc2 = vrotate(Loc2, <0, Count * 0.564666668998164, 0>); #declare Loc2 = Loc2 + <0, 0, 1000>; #declare Loc3 = vrotate(<-50, 100, 0>, <0, Count * 12.154224554, 0>); #declare Loc3 = Loc3 + <-1400, 0, 0>; #declare Loc3 = vrotate(Loc3, <0, Count * 1.2555166, 0>); #declare Loc4 = vrotate(<-50, 100, 0>, <0, Count * 19.9, 0>); #declare Loc4 = Loc4 + < 2000, 0, 0>; #declare Loc4 = vrotate(Loc4, <0, Count * .75545876456, 0>); #declare Loc4 = Loc4 + < 500, 0, 0>; #declare Loc5 = vrotate(<-30, 100, 0>, <0, Count * 30.5161689, 0>); #declare Loc5 = Loc5 + <1000, 0, 0>; #declare Loc5 = vrotate(Loc5, <0, Count * 2.546464616, 0>); sphere{0, 40 pigment { rgb <0, 1, 0>} translate Loc1} sphere{0, 40 pigment { rgb <1, 0, 0>} translate Loc2} sphere{0, 40 pigment { rgb <0, 0, 1>} translate Loc3} sphere{0, 40 pigment { rgb <1, 1, 0>} translate Loc4} sphere{0, 40 pigment { rgb <0, 1, 1>} translate Loc5} #declare LookAt = (Loc1 + Loc2 + Loc3 + Loc4 + Loc5)/5; sphere{0, 25 pigment { rgb <1, 0, 1>} translate LookAt} // #include "data.inc" #if(frame_number=1) #declare LookAt = ParseCenterOfMass(StartLookAt); #else ParseCenterOfMass(LookAt) #declare LookAt = CenterOfMassLookAt; #end #declare Direction = vlength(CameraLocation-LookAt)/2000; camera { location CameraLocation look_at LookAt direction z * Direction right image_width / image_height * x }