POV-Ray : Newsgroups : povray.newusers : gradient question : gradient question Server Time
5 Sep 2024 06:17:14 EDT (-0400)
  gradient question  
From: Lothar Esser
Date: 19 Sep 2001 14:08:32
Message: <3BA8DF4D.B476E3EC@helix.nih.gov>
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 thought I did
not understand it well enough so I played around with
other values just to find out that no matter what I use like <2,0.2,0>
or <0.1,2,0> or any other combination of numbers the color gradient on
my cylinder looks exactly the same. If someone would like an example I
can provide a simple povray input file.
I know a way around it would be to generate a generic cylinder of unit
length aligned with say x then apply a color gradient with using
gradient x and then I would have to scale and translate the whole thing
into its correct position. This can be done but seems rather
inconvenient.
My question is this: Is gradient broken for general vectors ? This could
be a potential problem for other people as well. Or am I doing something
wrong.
System: Irix 6.5 11m x-povray version 3.1g
Thanks,
   Lothar

--
Dr. Lothar Esser
NIH / NCI
Tel. 301-435-6163
email les### [at] helixnihgov


Post a reply to this message

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