// Title: LCH test scene // Author: Michael Horvath, http://isometricland.net // Created: 2016-11-20 // Updated: 2016-11-20 // This file is licensed under the terms of the CC-LGPL. #version 3.7; #include "strings.inc" #include "math.inc" #include "ColorMine.inc" global_settings { assumed_gamma 1.0 adc_bailout 0.005 max_trace_level 50 ambient_light 1/3 /* radiosity { pretrace_start 0.08 pretrace_end 0.01 count 50 error_bound 0.1 recursion_limit 1 normal on brightness 0.8 always_sample yes gray_threshold 0.8 media on } */ } camera { // orthographic location -z * 32 direction +z * 32 up +y * 2 right +x * 2 * image_width/image_height rotate +x * asind(tand(30)) rotate -y * 045 rotate +y * 180 } light_source { <-32,+32,-32,> color srgb 1 rotate y * 330 parallel point_at 0 shadowless } light_source { <-32,+32,-32,> color srgb 1 rotate y * 090 parallel point_at 0 // shadowless } background {color rgb 1/2} #macro round(X, Q) ceil(X * pow(10, Q) - 0.5) * pow(0.1, Q) #end #local VLCH = <100, 0, 0>; #local VLAB = CLCH2LAB(VLCH); #local VXYZ = CLAB2XYZ(VLAB); #local VRGB = CXYZ2RGB(VXYZ); #local VRGB = ; #debug concat("\nVLCH = ", vstr(3, VLCH, ", ", 0, 5), "\n") #debug concat("\nVLAB = ", vstr(3, VLAB, ", ", 0, 5), "\n") #debug concat("\nVXYZ = ", vstr(3, VXYZ, ", ", 0, 5), "\n") #debug concat("\nVRGB = ", vstr(3, VRGB, ", ", 0, 5), "\n") #local gap_width = 1/40; #local max_h = 36; #local max_l = 10; #local max_c = 10; #for (count_h, 1, max_h) #for (count_l, 0, max_l) #for (count_c, 1, max_c) #local VLCH = ; #local VLAB = CLCH2LAB(VLCH); #local VXYZ = CLAB2XYZ(VLAB); #local VRGB = CXYZ2RGB(VXYZ); // #debug concat("\nVLCH = ", vstr(3, VLCH, ", ", 0, 5), "\n") // #debug concat("\nVLAB = ", vstr(3, VLAB, ", ", 0, 5), "\n") // #debug concat("\nVXYZ = ", vstr(3, VXYZ, ", ", 0, 5), "\n") // #debug concat("\nVRGB = ", vstr(3, VRGB, ", ", 0, 5), "\n") #if ((count_h * 360/max_h < 270) & (round(VRGB.x,3) >= 0) & (round(VRGB.y,3) >= 0) & (round(VRGB.z,3) >= 0) & (round(VRGB.x,3) <= 1) & (round(VRGB.y,3) <= 1) & (round(VRGB.z,3) <= 1)) intersection { plane {+x, -gap_width rotate +y * 180/max_h} plane {-x, -gap_width rotate -y * 180/max_h} difference { cylinder {-y * (1/2 - gap_width), +y * (1/2 - gap_width), count_c + (1/2 - gap_width)} cylinder {-y * (1/2), +y * (1/2), count_c - (1/2 - gap_width)} } pigment {color srgb VRGB} finish {emission 0.3 diffuse 1} translate +y * (count_l - 5) rotate +y * (count_h * 360/max_h) scale 1/10 } #end #end #end #end #for (count_l, 0, max_l) #local VLCH = ; #local VLAB = CLCH2LAB(VLCH); #local VXYZ = CLAB2XYZ(VLAB); #local VRGB = CXYZ2RGB(VXYZ); // #if ((round(VRGB.x,1) >= 0) & (round(VRGB.y,1) >= 0) & (round(VRGB.z,1) >= 0) & (round(VRGB.x,1) <= 1) & (round(VRGB.y,1) <= 1) & (round(VRGB.z,1) <= 1)) difference { cylinder { -y * (1/2 - gap_width), +y * (1/2 - gap_width), 1/2 - gap_width } intersection { plane {+x,+gap_width rotate +y * 0} plane {-x,+gap_width rotate -y * 90} } pigment {color srgb VRGB} finish {emission 0.3 diffuse 1} translate +y * (count_l - 5) scale 1/10 } // #end #end