Povray:看似相同的颜色渐变中颜色的不同间距

Povray: Different spacing in colors in seemingly equivalent color gradients

我有一个关于 Povray 中颜色渐变的特别问题。 3D space 中有两个多边形,我想要从绿色到红色的均匀颜色渐变。我设法确定渐变的方向和比例以匹配多边形的方向。我可以决定在每个多边形上我想要多少个颜色循环。然而,多边形上的缩放比例不同。其中一个黄色条带比另一个大得多。我不知道,我能做些什么来反对它。非常感谢任何帮助。

这是生成图像的代码:

#version 3.6
#include "colors.inc"
#include "woods.inc"
#include "textures.inc"
#include "teak.map"

background {color Black}
camera {
    location <-250.0,0.0,0.0>
    right -x*1.0
    rotate <0,180,0>
    rotate <90,0,0>
    rotate<0,-20,0>
    rotate<0,0,30>
    rotate<0,0,138.9438202247191>
    look_at<0.0,0.0,0.0>
}
light_source {
    <100.0,100.0,100.0>
    color rgb <1.0,1.0,1.0>
    parallel
}
light_source {
    <-100.0,100.0,100.0>
    color rgb <1.0,1.0,1.0>
    parallel
}
light_source {
    <-100.0,-100.0,100.0>
    color rgb <1.0,1.0,1.0>
    parallel
}
light_source {
    <100.0,-100.0,100.0>
    color rgb <1.0,1.0,1.0>
    parallel
}
sphere{
     <-32.27486122,-11.07231728032198,-23.678890692790517>,5
    pigment {color rgb <1.00,1.00,1.00> transmit 0.00 }
    finish {
        ambient 0.10
        diffuse 0.90
        reflection {
            0.50
            metallic
        }
        brilliance 4.00
        phong 1.00
        phong_size 70
    }
    no_shadow
}
sphere{
     <0.0,-29.706217093395203,29.025736978774475>,5
    pigment {color rgb <1.00,0.00,1.00> transmit 0.00 }
    finish {
        ambient 0.10
        diffuse 0.90
        reflection {
            0.50
            metallic
        }
        brilliance 4.00
        phong 1.00
        phong_size 70
    }
    no_shadow
}
sphere{
     <-64.54972243926922,-66.97401672059644,-23.678890692641332>,5
    pigment {color rgb <0.00,0.00,1.00> transmit 0.00 }
    finish {
        ambient 0.10
        diffuse 0.90
        reflection {
            0.50
            metallic
        }
        brilliance 4.00
        phong 1.00
        phong_size 70
    }
    no_shadow
}
sphere{
     <-64.54972244425943,-29.706217093395203,29.025736980811743>,5
    pigment {color rgb <0.00,1.00,0.00> transmit 0.00 }
    finish {
        ambient 0.10
        diffuse 0.90
        reflection {
            0.50
            metallic
        }
        brilliance 4.00
        phong 1.00
        phong_size 70
    }
    no_shadow
}





#declare prism2= prism {//  b,g,w
    linear_spline
    0, 0.05, 4
    <37.213227646060446,2.0160796536642334>,<-20.352590020224387,31.219560673271918>,<-16.860637625836034,-33.23564032693614>,<37.213227646060446,2.0160796536642334>
    pigment{ gradient 0.45241838247136656*x+0.8918058124961915*z
        color_map{
            [0.0 color rgbt <0.0,1.0,0.0,0.0>]
            [0.5 color rgbt <1.0,1.0,0.0,0.0>]
            [1.0 color rgbt <1.0,0.0,0.0,0.0>]
        }
        scale 55.90169944156662*1.0000000000000002/1
        translate<-16.860637625836034,0.0,-33.23564032693614>-0.*55.90169944156662*(<0.45241838247136656,0.0,0.8918058124961915>)
    }

    finish {
        ambient 0.10
        diffuse 0.90
        brilliance 1.00
        phong 1.00
        phong_size 700
    }
    no_shadow
}
object{prism2 rotate<22.88208511441723,30.989723485425127,-107.73989543663471> translate<-53.628136051659965,-36.01179793559242,-6.0440148015284345>}


#declare prism2= prism {//m,g,w
    linear_spline
    0, 0.05, 4
    <32.274861221419805,-18.633899812579337>,<-32.274861222839625,-18.63389981450009>,<0.0,37.26779962707943>,<32.274861221419805,-18.633899812579337>
    pigment{ gradient -0.866025403787819*x-0.49999999999414496*z
        color_map{
            [0.0 color rgbt <0.0,1.0,0.0,0.0>]
            [0.5 color rgbt <1.0,1.0,0.0,0.0>]
            [1.0 color rgbt <1.0,0.0,0.0,0.0>]
        }
        scale 55.9944415488*1.0000000000000004/1
        translate<16.137430610709902,0.0,9.316949907250045>-0*55.90169944415488*(<-0.866025403787819,0.0,-0.499999414496>)
    }

    finish {
        ambient 0.10
        diffuse 0.90
        brilliance 1.00
        phong 1.00
        phong_size 700
    }
    no_shadow
}
object{prism2 rotate<-160.5287793660164,0.0,0.0> translate<-32.274861221419805,-23.683478964021134,11.390861088933567>}


这是第二张图片的代码。如果我想在每个多边形上有两个颜色循环,我必须在设置渐变比例的行中除以 2 而不是 1。

这是diffuse设置造成的;降低这将解决您的问题。根据文档,

The keyword diffuse is used in a finish statement to control how much 
of the light coming directly from any light sources is reflected via 
diffuse reflection. For example

  finish { diffuse 0.7 }

means that 70% of the light seen comes from direct illumination from 
light sources. The default value is diffuse 0.6.