POV-Ray : Newsgroups : povray.general : Trying to initialize an array with int's Server Time
15 Nov 2024 07:12:18 EST (-0500)
  Trying to initialize an array with int's (Message 1 to 3 of 3)  
From: Kent Larsson
Subject: Trying to initialize an array with int's
Date: 27 Oct 2004 05:15:53
Message: <417f6749$1@news.povray.org>
Hi!

I am quite new to PovRay, but it looks good from what i have done so 
far. I have a problem, i am trying to create a three-dimensional array 
and initialize it with normal int's. I can't seem to do that though, i 
am most likely doing something wrong.

The rest of this message is the code i have done at the moment which 
will not work:


#declare sideSize = 100;
#declare cFData = array[sideSize][sideSize][sideSize]; // x, y, z of 
3D-firematrix

#declare xCounter = 0;
#while (xCounter < sideSize) // Walk through x in the 3D-firematrix
         #declare yCounter = 0;
         #while (yCounter < sideSize) // Walk through y in the 3D-firematrix
                 #declare zCounter = 0;
                 #while (zCounter < sideSize) // Walk through z in the 
3D-firematrix
                         #declare cFData[xCounter][yCounter][zCounter] = 
0; // Initialize to 0
                         #declare zCounter = zCounter + 1;
                 #end
                 #declare yCounter = yCounter + 1;
         #end

         #declare xCounter = xCounter + 1;
#end

#declare pFData = cFdata;  // This line yields error about cFdata being 
uninitialized


Post a reply to this message

From: Slime
Subject: Re: Trying to initialize an array with int's
Date: 27 Oct 2004 07:09:20
Message: <417f81e0$1@news.povray.org>
> #declare pFData = cFdata;  // This line yields error about cFdata being
> uninitialized

Lowercase 'd' =)

 - Slime
 [ http://www.slimeland.com/ ]


Post a reply to this message

From: Kent Larsson
Subject: Re: Trying to initialize an array with int's
Date: 27 Oct 2004 11:22:02
Message: <417fbd1a@news.povray.org>
Oh! (opens a can of whop-ass on myself) Thanks!

>>#declare pFData = cFdata;  // This line yields error about cFdata being
>>uninitialized
> 
> 
> Lowercase 'd' =)
> 
>  - Slime
>  [ http://www.slimeland.com/ ]
> 
>


Post a reply to this message

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