Colors Povray:在看似相等的颜色渐变中,颜色的不同间距

Colors Povray:在看似相等的颜色渐变中,颜色的不同间距,colors,gradient,povray,Colors,Gradient,Povray,我有一个关于Povray中颜色渐变的特别问题。三维空间中有两个多边形,我希望有一个从绿色到红色的均匀颜色渐变。我设法确定了梯度的方向和比例,以匹配多边形的方向。我可以决定在每个多边形上有多少个颜色循环。然而,多边形上的缩放是不同的。其中一个的黄色条纹比另一个大得多。我不知道我能做些什么来对付它。非常感谢您的帮助 以下是生成图像的代码: #version 3.6 #include "colors.inc" #include "woods.inc" #in

我有一个关于Povray中颜色渐变的特别问题。三维空间中有两个多边形,我希望有一个从绿色到红色的均匀颜色渐变。我设法确定了梯度的方向和比例,以匹配多边形的方向。我可以决定在每个多边形上有多少个颜色循环。然而,多边形上的缩放是不同的。其中一个的黄色条纹比另一个大得多。我不知道我能做些什么来对付它。非常感谢您的帮助

以下是生成图像的代码:

#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>}


#版本3.6
#包括“颜色公司”
#包括“伍兹公司”
#包括“纹理公司”
#包括“柚木地图”
背景{黑色}
摄像机{
位置
右-x*1.0
旋转
旋转
旋转
旋转
旋转
看看
}
光源{
彩色rgb
平行的
}
光源{
彩色rgb
平行的
}
光源{
彩色rgb
平行的
}
光源{
彩色rgb
平行的
}
球体{
5.
颜料{颜色rgb透射0.00}
完成{
环境温度0.10
漫反射0.90
倒影{
0.50
金属的
}
华晨4.00
电话1.00
phong_尺码70
}
没有阴影
}
球体{
5.
颜料{颜色rgb透射0.00}
完成{
环境温度0.10
漫反射0.90
倒影{
0.50
金属的
}
华晨4.00
电话1.00
phong_尺码70
}
没有阴影
}
球体{
5.
颜料{颜色rgb透射0.00}
完成{
环境温度0.10
漫反射0.90
倒影{
0.50
金属的
}
华晨4.00
电话1.00
phong_尺码70
}
没有阴影
}
球体{
5.
颜料{颜色rgb透射0.00}
完成{
环境温度0.10
漫反射0.90
倒影{
0.50
金属的
}
华晨4.00
电话1.00
phong_尺码70
}
没有阴影
}
#声明prism2=prism{//b,g,w
线性U样条
0, 0.05, 4
,,,
颜料{梯度0.45241838247136656*x+0.8918058124961915*z
彩色地图{
[0.0彩色rgbt]
[0.5色rgbt]
[1.0彩色rgbt]
}
比例尺55.90169944156662*1.0000000000000002/1
翻译-0.*55.90169944156662*()
}
完成{
环境温度0.10
漫反射0.90
华晨1.00
电话1.00
phong_700码
}
没有阴影
}
对象{prism2旋转平移}
#声明prism2=prism{//m,g,w
线性U样条
0, 0.05, 4
,,,
颜料{梯度-0.866025403787819*x-0.499999994496*z
彩色地图{
[0.0彩色rgbt]
[0.5色rgbt]
[1.0彩色rgbt]
}
刻度55.9944415488*1.0000000000000004/1
翻译-0*55.90169944415488*()
}
完成{
环境温度0.10
漫反射0.90
华晨1.00
电话1.00
phong_700码
}
没有阴影
}
对象{prism2旋转平移}

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

这是由
漫反射设置引起的;这将解决你的问题。据文献记载,

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.