POV-Ray : Newsgroups : povray.newusers : Possible to use coordinates from an external text file? : Re: Possible to use coordinates from an external text file? Server Time
18 Apr 2024 01:30:55 EDT (-0400)
  Re: Possible to use coordinates from an external text file?  
From: Kenneth
Date: 20 Oct 2015 04:20:00
Message: <web.5625f8902a4ca8dd33c457550@news.povray.org>
"TomB" <nomail@nomail> wrote:

>
> I would like to know if it is possible to read in coordinates from an external
> text file. For example, if I want to create a number of spheres at coordinates
> [x,y,z], but these coordinates are stored in another file...

The #read directive in POV-Ray is quite useful and powerful for this kind of
thing. A possible stumbling-block is that your text file may not be in a form
that's immediately readable, as the #read directive requires a certain kind of
formatting. But that's fixable in any word-processing app (I use Edit Pad Lite
for this, to do any global search-and-replace of things that #read doesn't
handle well, liked tabbed white space for example.)

I would suggest trying to #read in your text file as-is, as a first try. It will
either work or it won't ;-) If it doesn't, then you'll need to 'massage' it
until it does. (That's a good learning exercise in itself!)


Post a reply to this message

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