POV-Ray : Newsgroups : povray.advanced-users : how do i get on the up and up with color? : Re: how do i get on the up and up with color? Server Time
2 Nov 2024 13:21:46 EDT (-0400)
  Re: how do i get on the up and up with color?  
From: Ken
Date: 10 Aug 1999 19:44:13
Message: <37B0B908.75630A9D@pacbell.net>
Noah A wrote:
> 
> i'm using a while statment to make a bunch of "things" as they rise on
> the y access i'd like them to incease certain colors. how would i use an
> array to do this?

An array is one possible solution but it would probably be easier to
eimple use the value of the while loop to increment the colors.

#declare a = 0;
  #while (a < 10 )
    sphere {<0,a,0>, 1
      pigment { rgb <a*0.1, a*0.1, a*0.1> }
      }
    }
  #declare a = a + 1;
#end

  The above example will change each rgb value by 0.1 for each sphere it
produces. There are tricks to using this approach and the example I gave
is a very basic one. If you really want to change the colors using an array
you will still need to write out each color you want to store in the array
before passing it into the while loop. This could be a very tedious task
but it is possible if you really want to do it. If my while loop example
is not what you want let me know and I will work out an array solution for
you.

-- 
Ken Tyler

See my 700+ Povray and 3D Rendering and Raytracing Links at:
http://home.pacbell.net/tylereng/index.html


Post a reply to this message

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