//Cleaned up version of another donut?? posted on images.binaries. //Isosurface donut stuff taken from material posted by TonyB //Pigment stuff taken from material posted by SamuelT //This file would not exist without their postings. //In fact, most of the code is cut directly from their files. #version unofficial MegaPOV 0.3; #include "colors.inc" // Major radius. #declare R0 = 0.9; // Minor radius. #declare R1 = 0.4; // Efficient bounding box for torus. #declare BOXL = < -(R0+R1), -R1, -(R0+R1)>; #declare BOXH = <(R0+R1), R1, (R0+R1)>; // Displacement ammount. #declare H = 0.05; // Maze( M_Dim, M_Complex, M_Randseed ) // // M_Dim is the dimensions for the tile. '4' would let you place it on a // 4-unit square cube // // M_Complex is how complex you want it. Values range from 0 to 2. // good values are from 1 to 2 // // M_Randseed is just the seed value for the maze. Enter any value to // see different patterns #macro Maze( M_Dim, M_Complex, M_Randseed ) #local M_Dim=M_Dim*8; #local M_Rand=M_Dim/20; #local M_Pat= function { pigment { image_map { pattern M_Dim, M_Dim{ function noise3d(x,y,z) scale( .25/M_Rand )/M_Complex translate y*rand( seed( M_Randseed ) ) } map_type 0 //include 'once' to test the tiling } translate<-.5, -.5, -.5> rotate x*90 scale M_Dim/4 } } #local M_Pigm= function { pigment { function M_Pat( x, y, z ) scale .5 pigment_map { [.5 function x*2 sine_wave color_map{ [.5 rgb 0][.5 rgb 1] } ] [.5 function z*2 sine_wave color_map{ [.5 rgb 0][.5 rgb 1] } ] } } } function{ M_Pigm( x, y, z ) } #end #declare DIMENSION=12; #declare COMPLEX=1.75; #declare SEED=13598; #declare C = pigment { Maze( DIMENSION, COMPLEX, SEED ) scale .06 rotate <-90,0,0> } // Torus function. #declare T = function { "torus", } // "Displacement-map" pigment function. #declare D = function { pigment { C warp { toroidal orientation z dist_exp 0.0 major_radius R0 } scale (1/DIMENSION) } } // Light! light_source { <.5,.5,-1>*R0*4 1} light_source { <0,0,0> <.5,.5,1> shadowless} // Camera! camera { location -z*R0*4 look_at 0 } // Action! //box{<1,1,.1>,<-1,-1,-.1> pigment {C} } isosurface { function { T(x,y,z) + H -2*D(x,y,z)*H } contained_by { box { BOXL,BOXH } } eval pigment { color rgb 1 } finish {ambient .4} rotate x*90 }