POV-Ray : Newsgroups : povray.general : <no subject> : Re: <no subject> Server Time
29 Jul 2024 04:23:10 EDT (-0400)
  Re: <no subject>  
From: stevenvh
Date: 16 Jan 2013 02:45:00
Message: <web.50f65a756f92e856209de68b0@news.povray.org>
"Kenneth" <kdw### [at] gmailcom> wrote:
> Besides Cousin's Ricky's suggestion, there are some other coding flaws (some of
> which I'm still trying to work through, to figure out what's going on.) I had to
> refer to section 3.2.1.8.2  "Array Initializers" in the documentation to brush
> up on array usage. But I can offer *some* help.
>
> It's probably best to examine your code part-by-part. Here's the first problem I
> see:
>
> #declare MyTable = array[3][6] {{0,0,0,0,0,0},{0,0,0,0,0,0},{0,0,0,0,0,0}}
> [snipped the rest. See Kenneth's post for the whole thing]

Thanks for the extensive reply. I really want a two-dimensional array, not a
one-dimensional array of vectors, like colors or positions. I got the structure
for the initialization from the documentation section 3.2.1.8.2:

#declare Digits =
array[4][10] {
  {7,6,7,0,2,1,6,5,5,0},
  {1,2,3,4,5,6,7,8,9,0},
  {0,9,8,7,6,5,4,3,2,1},
  {1,1,2,2,3,3,4,4,5,5}
  }

So that shows 4 rows of 10 columns, which is like the way I want it.

BTW, the problem was that I forgot the #declare to start the assignment. (It's
rather 1970s IMO, when you had to write "LET A = 1" in BASIC. Hope version 4
gets rid of it.


Post a reply to this message

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