POV Ray 3.7 code //======================================================= // 3D Heart shape generation by cellular automata // in ordinary triangles POV-Ray 3.7 //======================================================= s #include "heartPoints" #version 3.7 global_settings {assumed_gamma 1.0} camera { location <0, 0, -10.0> direction <0.0, 0.0, 1.0> up <0.0, 1.0, 0.0> right <1.33333, 0.0, 0.0> look_at <0, -1, 0> } light_source { < 7, 0, -40> rgb <1.000000, 1.000000, 1.000000> * 1.0 fade_distance 3 fade_power 0.3 } light_source{ <0,0,0> color rgb<1,1,1> area_light <5, 0, 0> <0, 0, 5> 6,6 // numbers in directions adaptive 1 // 0,1,2,3... jitter // random softening }//---- end of area_light #declare st = 1; #declare n = 20; #declare N = 1647; #declare Rnd_1 = seed (1153); #declare Rnd_2 = seed (553); #declare Rnd_3 = seed (876); #declare ii = 0; #declare pp = 0; #declare qq = 0; // replace N by N*clock for animation union{#for(j,0,int(N/6),1) // steps N/6 N/2 24*N 256*N 512*N 630*N #declare i = ii + st*pow(-1,int(N*rand(Rnd_1))); #for(k,0,n,1) #declare p = pp + st*pow(-1,int(n*rand(Rnd_2))); #declare q = qq + st*pow(-1,int(n*rand(Rnd_3))); #if (i > 0) #if(i < N) #if (p > 0) #if (p < n) #if (q > 0) #if(q <= p) #declare pp = p; #declare qq = q; #declare ii = i; #declare X = a[i][3] - (a[i][3] - a[i][0])*p/n + (a[i][6] - a[i][0])*q/n; #declare Y = a[i][4] - (a[i][4] - a[i][1])*p/n + (a[i][7] - a[i][1])*q/n; #declare Z = a[i][5] - (a[i][5] - a[i][2])*p/n + (a[i][8] - a[i][2])*q/n; sphere { < X, Y, Z >, 0.05 texture{ pigment{color < 1.0, 0.3, 0.2 > } finish { ambient rgb <0.3,0.1,0.1> diffuse 0.3 reflection 0.0 specular 0.0}} rotate <-90, 180, 0> rotate 0*clock*360 translate <0, -3, 0>} #end // end if #end // end if #end // end if #end // end if #end // end if #end // end if // #end // end if #end // k #end} // j