POV Ray 3.7 code //===================================================== // Cellular automata 3D Heart shape generation // by POV-Ray 3.7 //===================================================== #include "colors.inc" global_settings {assumed_gamma 1.0} background { color rgb <00,0.0,0.0> } camera { location <-20, 20, -250> look_at < 0, 0, 0> } light_source { < 20, 40, -120> rgb <1.000000, 1.000000, 1.000000> * 4.0 } #declare R = 60; #declare n = 300; #declare st = 1; #declare S = 1; // scale factor #declare Theta = -110; #declare Phi = 0; #declare Psi = -2; #declare X = array[n+1][n+1]; #declare Y = array[n+1][n+1]; #declare Z = array[n+1][n+1]; #for (p, 0, n,st) #declare th = p*2*pi/n; #for (q, 0, n,st) #declare ph = q*pi/n; #declare XX = S*R*cos(th)*sin(ph); #declare YY = S*R*sin(th)*sin(ph); #declare ZZ = R*cos(ph); #declare X[p][q] = XX + 0.0008*YY*YY; #declare Y[p][q] = 0.7*YY; #declare Z[p][q] = 2*ZZ*exp(-.3*(pi-ph)); #end // end for q #end // end for p #declare Rnd_1 = seed (1153); #declare Rnd_2 = seed (553); #declare pp = 0; #declare qq = 0; union{ #for(j,0,5*n*n) // steps 50*n, 100*n, 110*n, 200*n, 370*n, 5*n*n #declare p = pp + st*pow(-1,int(n*rand(Rnd_1))); #declare q = qq + st*pow(-1,int(n*rand(Rnd_2))); #if ( abs(p) < n) #if( abs(q) < n) #declare pp = p; #declare qq = q; sphere { < X[abs(p)][abs(q)], Y[abs(p)][abs(q)], Z[abs(p)][abs(q)] >,1 texture { pigment { color < 1.0, 0.5, 0.4 > } } finish { ambient rgb <0.3,0.1,0.1> diffuse .3 reflection 0.0 specular 0.0 } // plot sphere } translate < 0, 30, 20 > rotate < Theta, Phi, Psi > } #end // end if #end // end if #end} // end for j