POV-Ray : Newsgroups : povray.general : Slope buggerliness : Re: Slope buggerliness Server Time
4 Aug 2024 20:16:49 EDT (-0400)
  Re: Slope buggerliness  
From: hughes, b 
Date: 12 Feb 2003 12:47:26
Message: <3e4a88ae@news.povray.org>
Interesting. Yes, I see that if the X2T color has lower transmit it becomes
more like the comparison sphere. It looks the same at transmit 0, almost
okay still at 0.5, and then more yellow is introduced as that is raised
toward 1.

I have no idea what should be expected really though, so "okay" and
correctness is in question here, just that you seem to have found some kind
of discrepency. I'm reposting your script here because it was unparsable
before due to missing syntax, namely > and [.

// ----------------------------------------

#version 3.5;

global_settings {
  assumed_gamma 1.0
}

// ----------------------------------------

camera {
  location  <0.0, 0.0, -10.0>
  direction 1.5*z
  right     x*image_width/image_height
  look_at   <0.0, 0.0,  0.0>
}

sky_sphere {
  pigment {
    gradient y
    color_map {
      [0.0 rgb <0.6,0.7,1.0>]
      [0.7 rgb <0.0,0.1,0.8>]
    }
  }
}

light_source {
  <0, 0, 0>            // light's position (translated below)
  color rgb <1, 1, 1>  // light's color
  translate <-30, 30, -30>
  shadowless
}

// ----------------------------------------

plane {
  -z, -1
  pigment {
    hexagon
    color rgb 1.0
    color rgb 0.5
    color rgb 0.1
    scale 1.5
    rotate 90*x
  }
}

// ----------------------------------------

#declare F1 = finish { diffuse 0 ambient 1 reflection 0 specular 0 }
#declare F2 = finish { diffuse 1 ambient 0 reflection 0 specular 0 }
#declare F3 = finish { phong 0.4 }

#declare X1F = pigment { color rgbf < 1, 1, 0, 0 > }
#declare X2F = pigment { color rgbf < 0, 0, 1, 1 > }
#declare X1T = pigment { color rgbt < 1, 1, 0, 0 > }

 // change transmit value of color below to see changes
#declare X2T = pigment { color rgbt < 0, 0, 1, 1 > }

#declare X1O = pigment { color rgb  < 1, 1, 0 > }
#declare X2O = pigment { color rgb  < 0, 0, 1 > }

#declare S1 =  pigment { slope y  pigment_map { [ 0 X1F ] [1 X2F ] }}
#declare S2 =  pigment { slope y  pigment_map { [ 0 X1T ] [1 X2T ] }}
#declare S3 =  pigment { slope y  pigment_map { [ 0 X1O ] [1 X2O ] }}
#declare G1 =  pigment { function {0.5+asin(y)/pi}
pigment_map { [ 0 X1F ] [1 X2F ] }}
#declare G2 =  pigment { function {0.5+asin(y)/pi}
pigment_map { [ 0 X1T ] [1 X2T ] }}
#declare G3 =  pigment { function {0.5+asin(y)/pi}
pigment_map { [ 0 X1O ] [1 X2O ] }}

#declare sphere_tex_1 = texture { pigment { S1 } finish { F1 }}
#declare sphere_tex_2 = texture { pigment { S2 } finish { F1 }} /* */
#declare sphere_tex_3 = texture { pigment { S1 } finish { F2 }}
#declare sphere_tex_4 = texture { pigment { S2 } finish { F2 }}
#declare sphere_tex_9 = texture { pigment { S3 } finish { F3 }}

#declare sphere_tex_5 = texture { pigment { G1 } finish { F1 }}
#declare sphere_tex_6 = texture { pigment { G2 } finish { F1 }}
#declare sphere_tex_7 = texture { pigment { G1 } finish { F2 }}
#declare sphere_tex_8 = texture { pigment { G2 } finish { F2 }}
#declare sphere_tex_10 = texture { pigment { G3 } finish { F3 }}

// Left side group: 'Buggy' slope
union {
    sphere {0, 1 texture { sphere_tex_1 } translate  x+y}
    sphere {0, 1 texture { sphere_tex_2 } translate -x+y} // one to watch
    sphere {0, 1 texture { sphere_tex_3 } translate  x-y}
    sphere {0, 1 texture { sphere_tex_4 } translate -x-y}
    sphere {0, 1 texture { sphere_tex_9 } translate 3*y}

    translate -2.2*x-y
}

// Right side group: 'correct' function
union {
    sphere {0, 1 texture { sphere_tex_5 } translate  x+y}
    sphere {0, 1 texture { sphere_tex_6 } translate -x+y}
    sphere {0, 1 texture { sphere_tex_7 } translate  x-y}
    sphere {0, 1 texture { sphere_tex_8 } translate -x-y}
    sphere {0, 1 texture { sphere_tex_10 } translate 3*y}

    translate 2.2*x-y
}


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.