// This work is licensed under the Creative Commons Attribution 3.0 Unported License. // To view a copy of this license, visit http://creativecommons.org/licenses/by/3.0/ // or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, // California, 94041, USA. // // Persistence Of Vision Raytracer version 3.71 sample file. // // Demonstration of the potential pattern. // // +w800 +h600 +a0.3 // #version 3.71; global_settings { assumed_gamma 1 } #default { finish {ambient 0.006 diffuse 0.45} } #declare Grey50 = srgbft <0.5,0.5,0.5,0,0>; background { color Grey50 } #declare Camera00 = camera { perspective location <2.7,2.7,-2.701> sky <0,1,0> angle 35 right x*(image_width/image_height) look_at <0,0,0> } #declare White = srgbft <1,1,1,0,0>; #declare Light00 = light_source { <50,150,-250>, White } #declare Red = srgbft <1,0,0,0,0>; #declare CylinderX = cylinder { <-1,0,0>, <1,0,0>, 0.01 pigment { color Red } } #declare Green = srgbft <0,1,0,0,0>; #declare CylinderY = cylinder { <0,-1,0>, <0,1,0>, 0.01 pigment { color Green } } #declare Blue = srgbft <0,0,1,0,0>; #declare CylinderZ = cylinder { <0,0,-1>, <0,0,1>, 0.01 pigment { color Blue } } #declare Box00 = box { <-0.707,-0.707,-0.707>,<0.707,0.707,-0.407> rotate y*-45 } #declare Rose = srgbft <1,0,0.5,0,0>; #declare BlobLeft = blob { threshold 0.5 cylinder { <-0.5,-0.5,-0.5>, <-0.5,0.5,-0.5>, 0.2, 1 } pigment { color Rose } } #declare BlobCenter = blob { threshold 0.5 cylinder { <0.5,-0.5,-0.5>, <0.5,0.5,-0.5>, 0.2, 1 } } #declare BlobRight = blob { threshold 0.5 cylinder { <0.5,-0.5,0.5>, <0.5,0.5,0.5>, 0.2, 1 } } #declare UnionBlobs = union { object { BlobLeft } object { BlobCenter } object { BlobRight } pigment { color Rose } } #declare IntersectionCenter = intersection { object { Box00 } object { BlobCenter } } // Color map must align with potential pattern 'threshold on' #declare ColorMap00 = color_map { [ 0 Red ] [ 0.5 Green ] [ 0.51 Blue ] [ 1 Blue ] } #declare PigmentBlobCenterPotential = pigment { potential { BlobCenter } threshold on color_map { ColorMap00 } } #declare TextureBlobCenterPotential = texture { pigment { PigmentBlobCenterPotential } } #declare ObjectBlobCenterPotential = object { IntersectionCenter texture { TextureBlobCenterPotential } } #include "functions.inc" #declare FnBlobRightPotential = function { pattern { potential { BlobRight } threshold on } } #declare Brown = srgbft <0.5882,0.2941,0,0,0>; #declare IsoOfBlobRightPotential = isosurface { function { FnBlobRightPotential(x,y,z) } contained_by { box { <0,-1.1,0>,<1.1,1.1,1.1> } } polarity 1 // Works as I expect threshold 0 accuracy 0.0005 max_gradient 8.1 max_trace 1 pigment { color Brown } } #declare VarSphereRadius = 0.1; #declare FnSphere = function (x,y,z) { f_sphere(x-0.1,y-0.5,z+0.1,VarSphereRadius) } #declare IsoSphere = isosurface { function { FnSphere(x,y,z) } contained_by { box { <-0.2,0.3,-0.2>,<0.2,0.7,0.2> } } polarity 1 // Does nothing as far as I can tell threshold -VarSphereRadius accuracy 0.0005 max_gradient 2.1 max_trace 1 } #declare Box01 = box { <-0.1707,-0.2707,-0.1707>,<0.1707,0.9707,-0.1706> rotate y*-45 } #declare PigmentIsoSpherePotential = pigment { potential { IsoSphere } threshold on color_map { ColorMap00 } } #declare TextureIsoSpherePotential = texture { pigment { PigmentIsoSpherePotential } } #declare ObjectIsoSpherePotential = object { Box01 texture { TextureIsoSpherePotential } } //--- camera { Camera00 } light_source { Light00 } object { CylinderX } object { CylinderY } object { CylinderZ } object { BlobLeft } object { ObjectBlobCenterPotential } object { IsoOfBlobRightPotential } object { ObjectIsoSpherePotential }