POV-Ray : Newsgroups : povray.general : Reading coordinates into povray from an ascii file : Re: Reading coordinates into povray from an ascii file Server Time
29 Jul 2024 18:23:50 EDT (-0400)
  Re: Reading coordinates into povray from an ascii file  
From: Warp
Date: 13 Dec 2010 11:18:43
Message: <4d064762@news.povray.org>
John <jyo### [at] umichedu> wrote:
> I've managed to #fopen and apparently #read the file successfully -- well, at
> least without throwing an error -- but don't know how to assign the read
> material into an array that can be used in a while loop for rendering the many
> (e.g., hundreds) of rods specified in the text file.

  The file must contain comma-separated values. If it isn't already, then
it will be a bit difficult to read from POV-Ray directly.

  If you are able to generate the data file with whatever format you want,
you could write is as comma-separated values, but an even easier way is if
you write the data as an array declaration directly and then simply #include
the file in POV-Ray. (It would basically still be a list of comma-separated
values, but with an additional array declaration at the beginning, as well
as the curly brackets.)

-- 
                                                          - Warp


Post a reply to this message

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