// Title: CIE LCHuv Color Solid Cylinder Isosurface // Authors: Michael Horvath, Christoph Lipka // Website: http://isometricland.net // Created: 2016-12-11 // Updated: 2017-03-08 // 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 #version 3.7; #declare cie_ScaleAmount = 400; #declare cie_RotateAmount = -45; #declare cie_TransAmount = <0,-1/2,0>; #declare cie_AxesScale = 8/8; #declare cie_cam_distance = 22; #declare cie_cam_planesize = 2.2; #declare cie_cam_aspectratio = image_width/image_height; #include "math.inc" #include "colors.inc" #include "cie_color_conversion_formulas.inc" #include "cie_basic_scene_settings.inc" #declare cie_fOutR = function(H,C,L) {cie_funcHCL2RGBa1(H,C,L)} #declare cie_fOutG = function(H,C,L) {cie_funcHCL2RGBa2(H,C,L)} #declare cie_fOutB = function(H,C,L) {cie_funcHCL2RGBa3(H,C,L)} #declare cie_fInpH = function(x,y,z) {atan2d(z,x)} #declare cie_fInpC = function(x,y,z) {sqrt(x*x+z*z)*200} #declare cie_fInpL = function(x,y,z) {y*100} #declare cie_fFinal = function(H,C,L) { cie_fDist ( cie_fD(cie_fOutR(H,C,L)), cie_fD(cie_fOutG(H,C,L)), cie_fD(cie_fOutB(H,C,L)) ) } #declare cie_pigmentR = pigment { function {cie_linearRGBc(cie_fOutR(cie_fInpH(x,y,z),cie_fInpC(x,y,z),cie_fInpL(x,y,z)))} color_map { [0 color rgb <0,0,0>] [1 color rgb <3,0,0>] } } #declare cie_pigmentG = pigment { function {cie_linearRGBc(cie_fOutG(cie_fInpH(x,y,z),cie_fInpC(x,y,z),cie_fInpL(x,y,z)))} color_map { [0 color rgb <0,0,0>] [1 color rgb <0,3,0>] } } #declare cie_pigmentB = pigment { function {cie_linearRGBc(cie_fOutB(cie_fInpH(x,y,z),cie_fInpC(x,y,z),cie_fInpL(x,y,z)))} color_map { [0 color rgb <0,0,0>] [1 color rgb <0,0,3>] } } #declare cie_pigmentRGB = pigment { average pigment_map { [1 cie_pigmentR] [1 cie_pigmentG] [1 cie_pigmentB] } } #declare cie_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 cie_pigmentGradY = pigment { gradient y pigment_map { [ 0/20 cie_pigmentCyl] [ 1/20 cie_pigmentCyl] [ 1/20 color rgbt 9/10] [20/20 color rgbt 9/10] } frequency 5 scale 1.0001 } #declare cie_MinFactor = 1; #declare cie_surfShape = isosurface { function {cie_fFinal(cie_fInpH(x,y,z),cie_fInpC(x,y,z),cie_fInpL(x,y,z))} threshold 0 accuracy 0.001 contained_by { box {<-1,0,-1>,<+1,+1,+1>} // Maybe needs to be enlarged? Results of calculations are not clamped to this region necessarily. } // max_gradient 100 // was 20000 evaluate 15 * cie_MinFactor, 4 * cie_MinFactor, 0.7 all_intersections max_trace 3 } union { polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "cie_axis_H_cylinder_sans_cc_360.png"}} translate <-0.5, -0.5> scale 2*440/320 rotate +x * 90 rotate +y * 270 scale cie_AxesScale translate -0.00002 } polygon { 4, <0, 0,>, <1, 0,>, <1, 1,>, <0, 1,> pigment {image_map {png "cie_axis_L_C_cylinder_sans_luv_360.png"}} scale 440/320 translate -y * ((440-320)/2 * 440/320)/440 translate -x * ((440-320)/2 * 440/320)/440 scale cie_AxesScale translate -0.00001 } object { cie_surfShape pigment {cie_pigmentRGB} finish {emission 0.3 diffuse 1} translate +0.00001 } object { cie_cylShape // pigment {pigmentGradY} // pigment {pigmentRGB} pigment {color rgbt 7/8} } translate cie_TransAmount scale cie_ScaleAmount rotate y * clock * 360 }