POV-Ray : Newsgroups : povray.programming : Random and array : Re: Random and array Server Time
13 Jul 2024 10:25:49 EDT (-0400)
  Re: Random and array  
From: Jimi aka James
Date: 23 May 2009 06:15:00
Message: <web.4a17cbe128098316fb19e9110@news.povray.org>
Thx a lot guys... I was thinking a lot about this, and with your ideas I find
solution :)  This is the working code:

#local Index1 = 1;
#local Index3 = 0;
#declare chopek = union{
difference {
  sphere { <0, 0, 0>, 0.2  scale <0,4,0>}
  box {<0,0,0>, <1,0,1> }
            }

                       } // end of union

#declare glowa = union {
              sphere { <0, 0.7, 0>, 0.1 scale <0,1.3,0> pigment {color Yellow}}}
#while(Index1 <= 20)

   #local Index2 = 0;
   #while(Index2 <= 280)
      #declare kolorek = (Rand_Array_Item(lors,RS));
      object {chopek translate <Index3, Index1*0.5, Index2*0.5> pigment { color
kolorek }}
      object {glowa translate <Index3, Index1*0.5, Index2*0.5>}
        #if (Index2= 20 | Index2=65 | Index2 = 110 | Index2 = 155 | Index2 = 200
| Index2 = 245)
          #local Index2 = Index2 + 5;


        #else
      #local Index2 = Index2 + 1;
      #end
   #end

   #local Index1 = Index1 + 1;
   #local Index3 = Index3 +1;
#end

The declare of my chopek (man) and glowa (head) have to be declared before loop.
Str wasn't thing what I needed as you said.

And now as a dessert my work, people on the stadium on the bottom seats :-)

http://patryknowak.pl/stadion3.jpg

Once again thx for help :-)


Post a reply to this message

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