|
|
Dear
How about this is O.K. or NOT ?
color_map
{
[0.0 0.1 color Blue color Blue]
[0.9 1.0 color Yellow color Yellow]
} // close color_map
Y.Tanabe
Kobe,Japan
Dawn McKnight wrote:
> So, I'm working on this object. I won't bore you by telling you what it
> is, or what I'm using it for, or like that, but I will say that I'm
> trying to get a smooth color gradient between the edge and the center,
> which is to say, I need it to be a gradient in both x and z directions,
> constant as per y.
>
> Which sounds like a cylindrical pigment type, to me. I read the
> documentation, page 262, first paragraph, which says "It starts at 1.0
> at the origin and increases to a maximum [sic] value of 0.0 as it
> approaches a distance of 1 unit from the Y axis. It remains at 0.0 for
> all areas beyond that distance."
>
> So, if I understand this correctly, if I set a color_map with an entry
> of color Blue at 1.0, and color Yellow at 0.0, I should get a
> cylindrical pattern where the edge is yellow, and the center is blue,
> and in between is interpolated shading... in other words, various shades
> of green.
>
> Well, I don't need a one unit cylindrical pattern... I need one that's
> scaled to an ellipse of about 300x125 units. So I do the scaling, and
> translate the origin of the pattern to where I need it to be... and...
> Huh. that's weird. Instead of interpolated colors, I get an oval of
> blue, with a sharp-edge delineation where it becomes abruptly yellow.
>
> Also, it seems to actually start with 0.0 at the origin, and increase to
> 1.0, in contradiction to the documentation.
>
> Also, if I put in more than two colors, most of the color entries
> disappear... only the lowest value color, and the highest value color, appear.
>
> My code follows, so you can see for yourself what happens when it
> renders. If someone could confirm for me that this is a bug, or
> alternately, point out to me where I'm making my mistake, I'd be grateful.
>
> /*
> // Persistence of Vision Ray Tracer Scene Description File
> // File: bussard.pov
> // Vers: 3.1
> // Desc: bussard collector for the front of the nacelle
> // Date: 30 Oct '00
> // Last: 4 Nov '00
> // Auth: Dawn McKnight
> */
>
> background { color Black }
>
> light_source { <300, 50, 300> color White }
>
> camera {
> location <-500, 0, -400>
> look_at <-500, 0, 0>
> } // close camera
>
> #local Bus1 = intersection {
>
> prism {
> quadratic_spline
> linear_sweep
> -1, // height 1
> 1, // height 2.. this is just for visualization purposes, I'll extend
> it later.
> 6, // number of control points
> <200, 100>, <400, -25>, <185, -135>, <0, -25>, <200, 100>, <400, -25>
> } // close prism
>
> box {
> <214, -2, 120>,
> <-10, 2, -25>
> } // close box
>
> } // close intersection
>
>
> #local Bus2 = merge {
> object { Bus1 }
> object { Bus1 rotate 180*x translate -49.99*z }
> } // close merge
>
> #local BusCap = intersection {
> lathe {
> quadratic_spline
> 4,
> <-110, 185>, <0, 0>, <125, 200>, <0, 400>
> sturm
> //rotate 90*z
> } // close lathe
>
> box {
> <-130, -10, -130>,
> <130, 214, 0>
> } // close box
>
> } // close intersection
>
> #local BussCut = union {
> object { Bus2 scale 25*y rotate 90*x rotate 90*z translate 25*x}
> object { BusCap translate -25*z }
> object { BusCap rotate 180*y translate 25*z }
> } // close merge
>
> #local BusShape = merge {
> object { BussCut }
> box { <-125, 213.9, -25>, <125, 314, 25> }
> cylinder { <0, 213.9, -25>, <0, 314, -25>, 125 }
> cylinder { <0, 213.9, 25>, <0, 314, 25>, 125 }
> } // close union
>
> light_source {
> <0, 0, 0>
> color White
> looks_like {
> BusShape
> rotate -90*z
> pigment {
> cylindrical
> scale <300, 125, 125>
> translate 300*x
> color_map {
> [1.0 color Yellow]
> [0.1 color Blue]
> } // close color_map
> } // close pigment
> finish { ambient 0.8 diffuse 0.6 }
> } // close looks_like
> rotate 90*x
> translate <-700, -25, 0>
> } // close light_source
Post a reply to this message
|
|