POV-Ray : Newsgroups : povray.newusers : gradient question : Re: gradient question Server Time
5 Sep 2024 12:17:20 EDT (-0400)
  Re: gradient question  
From: Mike Williams
Date: 20 Sep 2001 00:21:32
Message: <IdxZqBAoEPq7Ew1L@econym.demon.co.uk>
Wasn't it Lothar Esser who wrote:
>Hi,
>   at the risk of embarrassing myself: I have a question about gradient
>in a pigment statement. What I want to do is to colour a cylinder which
>is not necessarily aligned with x,y,z or any simple combination of it
>from one end to the other with a simple gradient. For some reason an
>arbitrary vector in the gradient statement seems to be ignored.
>A statement like
>   cylinder {
>       <-1,-1,0>, <1,1,0>, 0.2
>       texture { pigment { gradient <1,1,0> color_map { [ 0.0 color rgb
>1] [1.0 color rgb <0,0,1>] } } } ... etc
>works but if I have a cylinder with the end points like <-0.1,-1,0>,
><0.1,1,0> then I cannot figure out what the correct
>gradient vector is: gradient <0.2,2,0> does not work.

I think it was a bug. It's fixed in POV_Ray 3.5b2.

In 3.5b2 both <0.1,1,0> and <0.2,2,0> work correctly.

(The only snag is that the gradient pattern is different in 3.5 in that
the colours always cycle in the same direction, whereas in 3.1 and all
previous versions the colours cycle in the opposite direction on the
other side of the origin.)

-- 
Mike Williams
Gentleman of Leisure


Post a reply to this message

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