POV-Ray : Newsgroups : povray.general : Arrays Server Time
7 Aug 2024 19:19:56 EDT (-0400)
  Arrays (Message 1 to 5 of 5)  
From: Bill DeWitt
Subject: Arrays
Date: 24 Jul 2001 18:22:03
Message: <3b5df50b$1@news.povray.org>
I think I may have just noticed my problem with arrays. I am sure I read
it once but I just noticed that the POV-Ray docs claim that arrays can only
be as large as array[5][x]. Is this true?!

    IOW, if I have a list of planetary data for 9 planets, listing their
name, radius, mass and distance from sun, I have to rearrange it into a list
of names, a list of masses, a list of radii and a list of distances? (I am
doing this anyway to see if it solves my problems, but I am mad that for all
this time I thought that I was just not understanding array initialization
and reading)

    Please tell me I am misreading things and that povray can take an
array[9][4]. Or, and this is the real question, that megapov can take arrays
of useful sizes.

    And -why- would someone bother to make an array function but only make
it good for [5][x]?


Post a reply to this message

From: Ron Parker
Subject: Re: Arrays
Date: 24 Jul 2001 18:28:17
Message: <slrn9lrtk3.p12.ron.parker@fwi.com>
On Tue, 24 Jul 2001 18:15:39 -0400, Bill DeWitt wrote:
>
>    I think I may have just noticed my problem with arrays. I am sure I read
>it once but I just noticed that the POV-Ray docs claim that arrays can only
>be as large as array[5][x]. Is this true?!

I think you're misreading it.  The limitation involving the number 5 is
that arrays can have no more than 5 dimensions, so array[9][4] is okay,
but array[2][2][2][2][2][2] is not.

>    IOW, if I have a list of planetary data for 9 planets, listing their
>name, radius, mass and distance from sun, I have to rearrange it into a list
>of names, a list of masses, a list of radii and a list of distances? (I am
>doing this anyway to see if it solves my problems, but I am mad that for all
>this time I thought that I was just not understanding array initialization
>and reading)

Note that once you fill in one value in an array, every other value in the
array must be of the same type.  Name and mass might not be the same type.

-- 
plane{-z,-3normal{crackle scale.2#local a=5;#while(a)warp{repeat x flip x}rotate
z*60#local a=a-1;#end translate-9*x}pigment{rgb 1}}light_source{-9red 1rotate 60
*z}light_source{-9rgb y rotate-z*60}light_source{9-z*18rgb z}text{ttf"arial.ttf"
"RP".01,0translate-<.6,.4,.02>pigment{bozo}}light_source{-z*3rgb-.2}//Ron Parker


Post a reply to this message

From: Bill DeWitt
Subject: Re: Arrays
Date: 24 Jul 2001 18:41:08
Message: <3b5df984$1@news.povray.org>
"Ron Parker" <ron### [at] povrayorg> wrote in message
news:slr### [at] fwicom...
> On Tue, 24 Jul 2001 18:15:39 -0400, Bill DeWitt wrote:
> >
> >    I think I may have just noticed my problem with arrays. I am sure I
read
> >it once but I just noticed that the POV-Ray docs claim that arrays can
only
> >be as large as array[5][x]. Is this true?!
>
> I think you're misreading it.  The limitation involving the number 5 is
> that arrays can have no more than 5 dimensions, so array[9][4] is okay,
> but array[2][2][2][2][2][2] is not.

    See, that's what I thought the first time I read it (from what I thought
the word "dimension" meant), but their examples led me to think otherwise.

    "Declaring Arrays...
     Multi-dimensional arrays
     up to five dimensions may
     be declared. For example:

     #declare MyGrid = array[4][5]"

    Your explanation makes more sense... I was just boggled that the pov
team thought that 5 items were all you needed...

> >    IOW, if I have a list of planetary data for 9 planets, listing their
> >name, radius, mass and distance from sun, I have to rearrange it into a
list
> >of names, a list of masses, a list of radii and a list of distances? (I
am
> >doing this anyway to see if it solves my problems, but I am mad that for
all
> >this time I thought that I was just not understanding array
initialization
> >and reading)
>
> Note that once you fill in one value in an array, every other value in the
> array must be of the same type.  Name and mass might not be the same type.

    Yeah, I was already planning to separate them into two arrays for my
purposes. Thanks for the quick reply. I am trying to finish off my gravity
well isosurface in the short times between dinner and work...


Post a reply to this message

From: Mr  Art
Subject: Re: Arrays
Date: 24 Jul 2001 19:53:24
Message: <3B5E42F2.58F59EC8@chesapeake.net>
On other projects I have "coded" the information so that the data stored
was all numeric but I made a decoding routine for displaying the
information.
Maybe you could do something like that with your project.

Bill DeWitt wrote:
> 
> "Ron Parker" <ron### [at] povrayorg> wrote in message
> news:slr### [at] fwicom...
> > On Tue, 24 Jul 2001 18:15:39 -0400, Bill DeWitt wrote:
> > >
> > >    I think I may have just noticed my problem with arrays. I am sure I
> read
> > >it once but I just noticed that the POV-Ray docs claim that arrays can
> only
> > >be as large as array[5][x]. Is this true?!
> >
> > I think you're misreading it.  The limitation involving the number 5 is
> > that arrays can have no more than 5 dimensions, so array[9][4] is okay,
> > but array[2][2][2][2][2][2] is not.
> 
>     See, that's what I thought the first time I read it (from what I thought
> the word "dimension" meant), but their examples led me to think otherwise.
> 
>     "Declaring Arrays...
>      Multi-dimensional arrays
>      up to five dimensions may
>      be declared. For example:
> 
>      #declare MyGrid = array[4][5]"
> 
>     Your explanation makes more sense... I was just boggled that the pov
> team thought that 5 items were all you needed...
> 
> > >    IOW, if I have a list of planetary data for 9 planets, listing their
> > >name, radius, mass and distance from sun, I have to rearrange it into a
> list
> > >of names, a list of masses, a list of radii and a list of distances? (I
> am
> > >doing this anyway to see if it solves my problems, but I am mad that for
> all
> > >this time I thought that I was just not understanding array
> initialization
> > >and reading)
> >
> > Note that once you fill in one value in an array, every other value in the
> > array must be of the same type.  Name and mass might not be the same type.
> 
>     Yeah, I was already planning to separate them into two arrays for my
> purposes. Thanks for the quick reply. I am trying to finish off my gravity
> well isosurface in the short times between dinner and work...


Post a reply to this message

From: Bill DeWitt
Subject: Re: Arrays
Date: 25 Jul 2001 09:59:22
Message: <3b5ed0ba$1@news.povray.org>
"Mr. Art" <mra### [at] chesapeakenet> wrote in message
news:3B5E42F2.58F59EC8@chesapeake.net...
> On other projects I have "coded" the information so that the data stored
> was all numeric but I made a decoding routine for displaying the
> information.
> Maybe you could do something like that with your project.

    Right, make it all text or something and then re-interpret it when you
need it. Good Idea.


Post a reply to this message

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