POV-Ray : Newsgroups : povray.programming : Random and array : Re: Random and array Server Time
26 Apr 2024 10:00:00 EDT (-0400)
  Re: Random and array  
From: clipka
Date: 22 May 2009 13:45:00
Message: <web.4a16e4772809831692f9e9e10@news.povray.org>
"Jimi aka James" <pat### [at] gmailcom> wrote:
>
> #declare lors = array[5] {Black,White,Red,Green,Blue}

Here, you declare "lors" as an array of colors...

> #declare kolorek = str((Rand_Array_Item(lors,RS))

.... here you seem to read out the array, and convert it to a string (why?? and
I'm rather surprised that you don't get an error here already)...

>       object {chopek translate <Index3, Index1*0.5, Index2*0.5> pigment { color
> kolorek }

.... while here again you want to have it interpreted as a color.

I guess it should work fine if you remove the "str()" from the declaration of
"kolorek"; actually, I think it should read:

#declare kolorek = Rand_Array_Item(lors,RS);


Post a reply to this message

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