POV-Ray : Newsgroups : povray.general : Easy array question Server Time
20 Nov 2024 10:36:33 EST (-0500)
  Easy array question (Message 1 to 3 of 3)  
From: Reusser
Subject: Easy array question
Date: 10 Sep 2001 19:25:54
Message: <100920011822245956%reu1000@chorus.net>
I feel like I must be missing something.  Why does pov not like the
last line?  It gives me the error, "attempted to redefine float
identifier as vector identifier."  It seems like there should be a way
to do this, but I'm not seeing it.


#declare blank_array1 = array[2]{<1,1,1>,<2,3,4>}
#declare blank_array = array[3]
#declare blank_array[0] = 0;
#declare blank_array[1] = blank_array[0] + 1;
#declare blank_array[2] = <1,2,3>;


Post a reply to this message

From: Warp
Subject: Re: Easy array question
Date: 10 Sep 2001 19:38:49
Message: <3b9d4f09@news.povray.org>
Reusser <reu### [at] chorusnet> wrote:
: I feel like I must be missing something.  Why does pov not like the
: last line?

  Because an array can have either floats or vectors, not both.

  The first value you put into the array defines the type of the elements.
So if you want vectors in there, you have to put <0,0,0> in there, not just 0.

-- 
#macro N(D,I)#if(I<6)cylinder{M()#local D[I]=div(D[I],104);M().5,2pigment{
rgb M()}}N(D,(D[I]>99?I:I+1))#end#end#macro M()<mod(D[I],13)-6,mod(div(D[I
],13),8)-3,10>#end blob{N(array[6]{11117333955,
7382340,3358,3900569407,970,4254934330},0)}//                     - Warp -


Post a reply to this message

From: Reusser
Subject: Re: Easy array question
Date: 11 Sep 2001 22:40:58
Message: <110920012137276303%reu1000@chorus.net>
In article <3b9d4f09@news.povray.org>, Warp <war### [at] tagpovrayorg> wrote:

>   Because an array can have either floats or vectors, not both.
> 
>   The first value you put into the array defines the type of the elements.
> So if you want vectors in there, you have to put <0,0,0> in there, not just 0.

Thanks.  Now I found the error that inputs the first value as a float
then doesn't accept any vectors.  That saves a lot of time and trouble.

 - Rico


Post a reply to this message

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