POV Ray 3.7 code //========================================================= // Quaternion 3D Julia-Mand-Mand fractal set // (\$C = -0.7454294\$) generated randomly // (POV-Ray point by point generation) //========================================================= #include "colors.inc" // Standard Color definitions #include "glass.inc" // Glass pigment effect #include "metals.inc" // Metal pigment effect global_settings {assumed_gamma 1.0} background { color rgb <00,0.0,0.0> } camera { // set view point (camera) location location <-20, 20, -300> look_at <-5, 0, 0> } light_source { // set point light sources location < -20, 20, -10> rgb <1.000000, 1.000000, 1.000000> * 2.0 } light_source { < 20, 20, -10> rgb <1.000000, 1.000000, 1.000000> * 3.0 } #declare R = .1; // set radius value #declare L = 2; // set square area side #declare Cx = -0.7454294; #declare n = 200; // set number of pixels per area side #declare st = 1; #declare N = 40; // N = 40 #declare Th = -45; #declare Ph = 30; #declare K = array[2*n+1][2*n+1][2*n+1]; #for (p, 0, n, st) #declare IncX = p*L/n; // Mand1 X increment #for (q, -n, n, st) #declare IncY = q*L/n; // Mand1 Y1 increment #for (r, -n, n, st) #declare IncZ = r*L/n; // Mand2 Y2 increment #declare X = IncX; // start JuliaX #declare Y = 0; // start MandY #declare Z = 0; // start MandZ #declare K[p+n][q+n][r+n] = 0; #for (k,1,N) #declare XX = X*X - Y*Y - Z*Z + Cx; // cycle JuliaX #declare YY = 2*X*Y + IncY; // cycle MandY #declare ZZ = 2*X*Z + IncZ; // cycle MandZ #declare X = XX; #declare Y = YY; #declare Z = ZZ; #declare W = X*X +Y*Y + Z*Z; #if ( W > R) // escape if #if (W < R + 0.0015) // escape if sphere { < p, q, r >, 1 // adding 3d axis texture { pigment { color Col_Yellow } } finish { ambient rgb <0.3,0.1,0.1> diffuse .3 reflection .3 specular 1 } // plot sphere } #end // end if #end // end if #end // end for k #end // end for q #end // end for p #end // end for r #declare Rnd_1 = seed (1153); #declare Rnd_2 = seed (553); #declare Rnd_3 = seed (876); union{ // replace n*n*n by n*n*n*clock for animation #for(j,0,n*n*n) // alternative n*n*n/16 n*n*n/64 n*n*n/256 #declare p = int(2*n*rand(Rnd_1)); #declare q = int(2*n*rand(Rnd_2)); #declare r = int(2*n*rand(Rnd_3)); #if(K[p][q][r] > 0) sphere { < -n+p, -n+q, -n+r >, 1 texture { pigment { color Col_Glass_Yellow } } finish { ambient rgb <0.3,0.1,0.1> diffuse .3 reflection .3 specular 1 } // plot sphere translate < 30, 15, 10 > rotate < Th, Th, Ph >} #end // end if #end} // end for j