POV-Ray : Newsgroups : povray.general : Trying to initialize an array with int's : Trying to initialize an array with int's Server Time
2 Aug 2024 12:22:12 EDT (-0400)
  Trying to initialize an array with int's  
From: Kent Larsson
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

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