POV-Ray : Newsgroups : povray.newusers : Arrays with default value... Server Time
29 Jul 2024 08:21:12 EDT (-0400)
  Arrays with default value... (Message 1 to 4 of 4)  
From: danyolgiax
Subject: Arrays with default value...
Date: 4 May 2006 16:15:01
Message: <web.445a5ff0bea7939358dbbb6b0@news.povray.org>
Is this the only way to set a default value?

#declare numBuildings=12;
#declare contatore=0;
#declare noRender=array[numBuildings];

#while (contatore<numBuildings)

    #declare noRender[contatore]=1;
    #declare contatore=contatore+1;

#end


Post a reply to this message

From: Warp
Subject: Re: Arrays with default value...
Date: 4 May 2006 16:34:50
Message: <445a656a@news.povray.org>
danyolgiax <d.o### [at] gmailcom> wrote:
> Is this the only way to set a default value?

  Yeah.

-- 
                                                          - Warp


Post a reply to this message

From: Trevor G Quayle
Subject: Re: Arrays with default value...
Date: 4 May 2006 22:33:25
Message: <445ab975$1@news.povray.org>
"danyolgiax" <d.o### [at] gmailcom> wrote in message 
news:web.445a5ff0bea7939358dbbb6b0@news.povray.org...
> Is this the only way to set a default value?
>
> #declare numBuildings=12;
> #declare contatore=0;
> #declare noRender=array[numBuildings];
>
> #while (contatore<numBuildings)
>
>    #declare noRender[contatore]=1;
>    #declare contatore=contatore+1;
>
> #end
>

or

#declare noRender=array[numBuildings] {1,1,1,1,1,1,1,1,1,1,1,1};

This is good for small arrays, but can be tedious for large arrays.

-tgq


Post a reply to this message

From: Warp
Subject: Re: Arrays with default value...
Date: 5 May 2006 06:13:19
Message: <445b253d@news.povray.org>
Trevor G Quayle <Tin### [at] hotmailcom> wrote:
> #declare noRender=array[numBuildings] {1,1,1,1,1,1,1,1,1,1,1,1};

  That doesn't work if numBuildings changes.

-- 
                                                          - Warp


Post a reply to this message

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