// Title: XYZ Color Solid Cube Isosurface // Authors: Michael Horvath, Christoph Lipka // Website: http://isometricland.net // Created: 2017-03-07 // Updated: 2017-03-07 // This file is licensed under the terms of the CC-GNU LGPL. // http://www.gnu.org/licenses/lgpl-2.1.html // Illuminant = D65 // Observer = 2° (1931) // +kfi0 +kff15 +kc // +k0.625 #version 3.7; #declare ScaleAmount = 400; #declare RotateAmount = -22.5; // was 15 #declare AxesScale = 8/8; #include "math.inc" #include "colors.inc" #include "cie_color_conversion_formulas.inc" #include "cie_basic_scene_settings.inc" #declare fOutR = function(X,Y,Z) {funcXYZ2RGBb1(X,Y,Z)} #declare fOutG = function(X,Y,Z) {funcXYZ2RGBb2(X,Y,Z)} #declare fOutB = function(X,Y,Z) {funcXYZ2RGBb3(X,Y,Z)} #declare fInpX = function(x,y,z) {x*128} // should this be capped at 100? #declare fInpY = function(x,y,z) {y*128} // should this be capped at 100? #declare fInpZ = function(x,y,z) {z*128} // should this be capped at 100? #declare fFinal = function(X,Y,Z) { fDist ( fD(fOutR(X,Y,Z)), fD(fOutG(X,Y,Z)), fD(fOutB(X,Y,Z)) ) } #declare pigmentR = pigment { function {linearRGBc(fOutR(fInpX(x,y,z),fInpY(x,y,z),fInpZ(x,y,z)))} color_map { [0 color rgb <0,0,0>] [1 color rgb <3,0,0>] } } #declare pigmentG = pigment { function {linearRGBc(fOutG(fInpX(x,y,z),fInpY(x,y,z),fInpZ(x,y,z)))} color_map { [0 color rgb <0,0,0>] [1 color rgb <0,3,0>] } } #declare pigmentB = pigment { function {linearRGBc(fOutB(fInpX(x,y,z),fInpY(x,y,z),fInpZ(x,y,z)))} color_map { [0 color rgb <0,0,0>] [1 color rgb <0,0,3>] } } #declare pigmentRGB = pigment { average pigment_map { [1 pigmentR] [1 pigmentG] [1 pigmentB] } } #declare pigmentCyl = pigment { cylindrical color_map { [ 0/20 color rgbt 10/10] [ 1/20 color rgbt 10/10] [ 1/20 color rgbt 9/10] [20/20 color rgbt 9/10] } frequency 5 scale 1.0001 } #declare pigmentGradY = pigment { gradient y pigment_map { [ 0/20 pigmentCyl] [ 1/20 pigmentCyl] [ 1/20 color rgbt 9/10] [20/20 color rgbt 9/10] } frequency 5 scale 1.0001 } //#declare isoShape = isosurface { function {fFinal(fInpX(x,y,z),fInpY(x,y,z),fInpZ(x,y,z))} threshold 0 accuracy 0.001 contained_by { box {0,2} } max_gradient 50 // was 20000 all_intersections max_trace 3 pigment {pigmentRGB} translate <-1/2,-1/2,-1/2> rotate y * clock * 360 scale ScaleAmount } /* union { polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "axis_a_b_cube.png"}} // translate <-0.5, -0.5> scale 440/320 translate -y * ((440-320)/2 * 440/320)/440 translate -x * ((440-320)/2 * 440/320)/440 rotate +x * 90 scale AxesScale translate -0.000001 } polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "axis_L_cube.png"}} // translate <-0.5, -0.5> scale 440/320 translate -y * ((440-320)/2 * 440/320)/440 translate -x * ((440-320)/2 * 440/320)/440 // rotate +x * 90 scale AxesScale translate -0.000001 } object { isoShape pigment {pigmentRGB} finish {emission 0.3 diffuse 1} } object { cubShape // pigment {pigmentGradY} pigment {color rgbt 7/8} } // object {axesShape} translate <-1/2,-1/2,-1/2> rotate y * clock * 360 scale ScaleAmount } */