On Wed, 2 Jul 2003 00:26:48 +0800, "aaaz123456" <aaa### [at] yahoocomtw> wrote:
> How to read a lot of data from a file into a N*M array?
Running loop with necessary number of passes to read N*M elements which is
simplest to understand when realized as N loops of M loops of simple reading.
#local N=...; // fill with
#local M=...; // favorite dimensions
#local Array=array[N][M];
#fopen MyFile "myfile.txt" read
#local n=0;
#while (n<N)
#local m=0;
#while (m<M)
#read(MyFile,Array[n][m])
#local m=m+1;
#end
#local n=n+1;
#end
#fclose MyFile
Look at http://www.povray.org/documentation/view/147/ for further description of
used directives
ABX
Post a reply to this message
|