POV-Ray : Newsgroups : povray.general : a simple question about File I/O : Re: a simple question about File I/O Server Time
4 Aug 2024 06:12:01 EDT (-0400)
  Re: a simple question about File I/O  
From: ABX
Date: 1 Jul 2003 12:42:38
Message: <9td3gvcapg56dpk1qgbo20idgu2bnsi7mh@4ax.com>
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

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