// Last edited on 2011-08-29 22:15:06 by stolfilocal // Generic frame of a simple movie // (Tumbling spheres and cylinders) background{ color rgb < 0.75, 0.80, 0.85 > } // A parameter that varies {+1, 00, -1, 00, +1}: #declare ctt = cos(2*pi*clock); // A parameter that varies {00, +1, 00, -1, 00}: #declare stt = sin(2*pi*clock); // A parameter that varies {00, +1, 00, +1, 00}: #declare stt2 = stt*stt; // A parameter that varies {00, +1, 00}: #declare htt = 0.5*(1-ctt); #include "textures.inc" #include "slave.inc" #include "slave_walking.inc" #macro walk_of_slave_frame(walk,NC) // A slave walking on pavement through {NC} walking cycles. // Starts with mid-hips on Z axis. #local wphase = NC*clock; #local footprints_ht = 5; #local footprints = slave_walking_multiple_footprints(walk,NC,footprints_ht) union{ object{ slave_walking_multiple(walk,NC,wphase, 0,0,0,0,tx_white) texture{ tx_white } } object{ footprints } text{ ttf "arial.ttf" str(wphase,5,3) 0.002, 0 texture{ tx_rod } scale 150 rotate 90*x translate 1800*z } plane{ z,0 texture{ tx_chess scale 200 } translate -footprints_ht*z } } #declare cam_rad = 4000; #declare cam_ctr = < 0, 5000, -400 >; #declare cam_dir = <2,-10,2>; #end #macro walk_of_chain_gang_frame(walk,NC,coin,NSX,spc_X,NSY,spc_Y) // A slave walking on pavement through {NC} walking cycles. // Starts with mid-hips on Z axis. // {spc} longitudianl #local wphase = NC*clock; #local footprints_ht = 5; #local footprints = slave_walking_multiple_footprints(walk,NC,footprints_ht) union{ #local ix = 0; #while (ix < NSX) #local iy = 0; #while (iy < NSY) #local wp = wphase + 0.05*(2*rand(coin) - 1); object{ slave_walking_multiple(walk,NC,wp, 0,0,0,0,tx_white) texture{ tx_white } translate ix*spc_X*x + iy*spc_Y*y } #local iy = iy + 1; #end #local ix = ix + 1; #end object{ footprints } text{ ttf "arial.ttf" str(wphase,5,3) 0.002, 0 texture{ tx_rod } scale 150 rotate 90*x translate 1800*z } plane{ z,0 texture{ tx_chess scale 200 } translate -footprints_ht*z } } #declare cam_rad = 4000; #declare cam_ctr = < 1000+2000*clock, 5000, -400 >; #declare cam_dir = <2,-10,2>; #end #local coin = seed(4615); union{ // object{ walk_of_slave_frame(1.0,3) } object{ walk_of_chain_gang_frame(0.5,3, coin, 4,900,3,800) } }