#version 3.8; global_settings { assumed_gamma 1 } default { finish {ambient 0.1} } #declare Black = srgb <0,0,0>; background { color Black } #declare Camera00 = camera { perspective location <5,10,-5.0001> sky y angle 35 right x*(image_width/image_height) look_at <0,0,0> } #declare White = srgb <1,1,1>; #declare Light00 = light_source { <-150,150,-250>, White } #declare Vulcan = srgb <0.06275,0.07059,0.11373>; #declare Plane00 = plane { <0,1,0>, 0 pigment { color Vulcan } } #include "functions.inc" #declare F_crackle = function { pattern { crackle metric 2 form <-1.20,0.00,0.30> poly_wave 0.33 scale 0.03 scale <1,2,111> warp { turbulence 0.3 } } } #declare VarDeltaX = 0.62; #declare VarDeltaY = 0.32; // Global x,y,z into these for per cell/mod() stuff. #declare F_cellsX = function { pattern {cells translate <321,654,987> scale } } #declare F_cellsY = function { pattern {cells translate <654,987,321> scale } } #declare F_cellsZ = function { pattern {cells translate <987,321,654> scale } } #declare F_A00 = function (x,y,z) { f_rounded_box(x,y,z,0.07,0.07,0.1,0.07) } #declare F_A01 = function (x,y,z) { f_rounded_box(x,y,z,0.04,0.30,0.07,0.15) } #declare F_A01n = function (x,y,z,gx,gy,gz) { f_rounded_box(x,y,z,0.04,0.30,0.07,0.15) + (F_crackle(F_cellsX(gx,gy,gz)*50000+x*3, F_cellsY(gx,gy,gz)*50000+y*3, F_cellsZ(gx,gy,gz)*50000+z*3)*0.667) + (f_granite(F_cellsX(gx,gy,gz)*50000+x*3, F_cellsY(gx,gy,gz)*50000+y*3, F_cellsZ(gx,gy,gz)*50000+z*3)*0.013) } #declare F_B00_CntX = 7; #declare F_B00_StepX = 0.4; #declare F_B00 = function (x,y,z) { F_A00(((abs(x)<(F_B00_CntX*F_B00_StepX)))* mod(abs(x),F_B00_StepX)-F_B00_StepX/2,y,z) } #declare F_B01_CntX = 4; #declare F_B01_StepX = VarDeltaX; #declare F_B01_CntZ = 4; #declare F_B01_StepZ = VarDeltaY; #declare F_B01 = function (x,y,z) { F_A01(((abs(x)<(F_B01_CntX*F_B01_StepX)))* mod(abs(x),F_B01_StepX)-F_B01_StepX/2, y,((abs(z)<(F_B01_CntZ*F_B01_StepZ)))* mod(abs(z),F_B01_StepZ)-F_B01_StepZ/2) } #declare F_B01n_CntX = 4; #declare F_B01n_StepX = VarDeltaX; #declare F_B01n_CntZ = 4; #declare F_B01n_StepZ = VarDeltaY; #declare F_B01n = function (x,y,z,gx,gy,gz) { F_A01n(((abs(x)<(F_B01n_CntX*F_B01n_StepX)))* mod(abs(x),F_B01n_StepX)-F_B01n_StepX/2, y,((abs(z)<(F_B01n_CntZ*F_B01n_StepZ)))* mod(abs(z),F_B01n_StepZ)-F_B01n_StepZ/2, gx,gy,gz) } #declare F_B01nn = function (x,y,z) { F_B01n(x,y,z,x,y,z) } // Set up for Iso97 shapes on spiral. #declare F_C00r = function (x,y,z) { div(sqrt(x*x+z*z),0.4)*0.4 } #declare F_00 = function (x,y,z) { F_B00(x*cos(F_C00r(x,y,z))-z*sin(F_C00r(x,y,z)), y,x*sin(F_C00r(x,y,z))+z*cos(F_C00r(x,y,z))) } #declare Cyan = srgb <0,1,1>; #declare Iso97 = isosurface { function { F_00(x,y,z) } contained_by { box { <-3,-0.1,-3>,<3,0.2,3> } } threshold 0 accuracy 0.0005 max_gradient 10 pigment { color Cyan } translate <0,0.25,0> } #declare Iso98 = isosurface { function { F_B01(x,y,z) } contained_by { box { <-3,-0.1,-1.5>,<3,0.2,1.5> } } threshold 0 accuracy 0.0005 max_gradient 1.4 } #declare Iso99 = isosurface { function { F_B01nn(x,y,z) } contained_by { box { <-3,-0.1,-1.5>,<3,0.2,1.5> } } threshold 0 accuracy 0.0005 max_gradient 5.1 } // Randomize the brick colors #declare F_cellsXR = function (x,y,z) { 0.75686-(0.075/2)+((0.075*2)*F_cellsX(x,y,z)) } #declare F_cellsYG = function (x,y,z) { 0.71765-(0.071/2)+((0.071*2)*F_cellsY(x,y,z)) } #declare F_cellsZB = function (x,y,z) { 0.64314-(0.064/2)+((0.064*2)*F_cellsZ(x,y,z)) } #declare PigmentBrick = pigment { user_defined { function { F_cellsXR(x,y,z) }, function { F_cellsYG(x,y,z) }, function { F_cellsZB(x,y,z) }, , } } #declare FinishBrick = finish { phong 0.8 } #declare TextureBrick = texture { pigment { PigmentBrick } finish { FinishBrick } } #declare ObjectBricks98 = object { Iso98 texture { TextureBrick } scale 1.15 } #declare ObjectBricks99 = object { Iso99 texture { TextureBrick } scale 1.15 } //--- scene --- camera { Camera00 } light_source { Light00 } object { Plane00 } object { Iso97 } // Shapes on spiral curve // object { ObjectBricks98 } // Simple version object { ObjectBricks99 }