POV-Ray : Newsgroups : povray.general : Parsing a data set : Re: Parsing a data set Server Time
4 Aug 2024 16:08:34 EDT (-0400)
  Re: Parsing a data set  
From: oliWood
Date: 29 Mar 2003 20:10:03
Message: <web.3e864229eb11af8459ddf11d0@news.povray.org>
Tim Nikias v2.0 wrote:
>If you'd set your JAVA program to output like this:
>Coordinate , Orientation, Coordinate, Orientation, ...,
>if you know the amount of boids, and if you make sure
>that there's always a comma after every coordinate
>or orientation (even after the last one!), you could use
>something like:
>
>#declare Boid_Amount=0;
>#declare _Counter=0;
>#fopen _D Data_File read
>//This jumps ahead to the needed frame
>#while (_Counter<frame_number*Boid_Amount)
> #read (_D,_Coord, _Orient)
> #declare _Counter=_Counter+1;
>#end
>
>//This reads the required data
>#while(defined(Data_File) & Boid<Boid_Amount)
> #read (_D, _Coord, _Orient)
> #declare Boid=Boid+1;
> [... Do some stuff with _Coord and _Orient to place a boid ...]
>#end
>#fclose _D


And that will do the job nicely !
Thanks for getting me started - I should have been more organised, but the
deadline is running up close - will posta finished animation as soon as i
have one.

Thanks once again,

oli


Post a reply to this message

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