//http://local.wasp.uwa.edu.au/~pbourke/fractals/lorenz/ #include "colors.inc" camera { location <60, 30, 20> look_at <10, 10, 20> } light_source { <100, 100, -10> color White} light_source { <-10, 1, -10> color .5*White} // N = number iterations // h, a, b, c: initial parameters // x0, y0, z0: start-location // rad = radius of the spheres that trace the attractor #macro lorenz(h, a, b, c, x0, y0, z0, N, rad) // use it like: // lorenz(0.001099, 10, 28, 8/3, 0.0001, 0.0001, 0.0001, 350000, 0.04) #local i = 0; union { #while (i < N) #local x1 = x0 + h * a * (y0 - x0); #local y1 = y0 + h * (x0 * (b - z0) - y0); #local z1 = z0 + h * (x0 * y0 - c * z0); #if (i > 100) sphere { , rad pigment { color rgb } } #end #local i = i + 1; #local x0 = x1; #local y0 = y1; #local z0 = z1; #end pigment { rgb <1,0,1> } } #end lorenz(.01,10,28, 8/3, .1,0,0, 10000, .4)