POV-Ray : Newsgroups : povray.advanced-users : reading external files Server Time
25 Nov 2024 21:47:15 EST (-0500)
  reading external files (Message 1 to 2 of 2)  
From: zhiwu (david) fang
Subject: reading external files
Date: 14 Mar 2002 16:08:09
Message: <3C9111A6.5552AA72@caltech.edu>
>I was trying to animate the process of multiple particle collisions
with
> generated data by another program. The data file contains position,
> translational velocity & angular velocity for N particle on T steps. I

> used #while-#end directive and  a counter "istep"  trying to read in
> data for all T steps, but it seems that it repeatedly  read data for
> first step. Could anybody help me out?  With my thanks in advance.
>
> david

I was redirected to post this question here. I figured it out why but
still
need help.

Every time POV-Ray reads an external file, it starts from the first
record.
So what I did was to read in N*clock*#IFF for current  "clock",  and
skip
first N*(clock*#IFF -1). The approach is very inefficient if the data
file
is big. I was wondering if anybody has better idea. Thanks.

David


Post a reply to this message

From: Christoph Hormann
Subject: Re: reading external files
Date: 14 Mar 2002 16:15:30
Message: <3C9112F1.7A251548@gmx.de>
"zhiwu (david) fang" wrote:
> 
> [...]
> 
> Every time POV-Ray reads an external file, it starts from the first
> record.
> So what I did was to read in N*clock*#IFF for current  "clock",  and
> skip
> first N*(clock*#IFF -1). The approach is very inefficient if the data
> file
> is big. I was wondering if anybody has better idea. Thanks.

One obvious approach is to split the data into several small files.  

In megapov you can also use 'persistence of variables' function to avoid
newly reading the file for every frame.

Christoph

-- 
POV-Ray tutorials, IsoWood include,                 
TransSkin and more: http://www.tu-bs.de/~y0013390/  
Last updated 13 Mar. 2002 _____./\/^>_*_<^\/\.______


Post a reply to this message

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