|
|
Grassblade <nomail@nomail> wrote:
> Nifty! But it seems you have to know beforehand the number of data to be
> read, is there some way to have something similar to dimension_size?
It's naturally impossible to know the amount of numbers in the input
file before the file has been parsed.
There are two possible solutions:
If you can make the program which creates the data file to store the
amount of values as the first value, that would be the easiest way of
automatically getting this value in the pov file.
If that's just not possible, then you can simulate dynamic arrays in
povray by first creating an array of certain size, reading data into it,
and if it fills up, create a bigger array, copy the data from the old one
to this new one, and then continue reading values, and so on. In the end,
if an exact array (without unused values at the end) is needed, you can
create an array of that exact size and copy the data there.
--
- Warp
Post a reply to this message
|
|