POV-Ray : Newsgroups : povray.animations : Leaving a Trail : Re: Leaving a Trail Server Time
18 May 2024 10:50:08 EDT (-0400)
  Re: Leaving a Trail  
From: Rune
Date: 20 Jun 2007 06:15:39
Message: <4678fe4b$1@news.povray.org>
OpalPlanet wrote:
> I think sphere_sweep would work better, but i am having difficultly
> placing the control points. I have .txt data files with <t,x,y,z>
> data for all the planets, and i wanted to read that in and use each
> pint as one of the control points. I'm new to this, but here is my
> best go at using a while loop:

>  #switch(pathcount)
>    #case(1)                  //Mercury
>      #declare n = 0;
>      #while( n < cnt)
>       #read(mercury,tt,xx,yy,zz)
>       #declare n = n +1;
>      #end
>      #render concat("Read up to file line ",str(n,6,0),"n")
>   #break

Hmm.

What is tt, xx, yy and zz ? They would need to be arrays when you want to 
store many points in them.

So you would #declare xx, yy, zz and tt as arrays with size cnt (I presume 
cnt is #declared elsewhere).

Then you'd use:

       #read(mercury,tt[n],xx[n],yy[n],zz[n])

And when you want to use the points:

 #while ( n<cnt)
 <xx[n],yy[n],-zz[n]>, .01
 #declare n = n +1;
 #end

I'm a bit rusty with File I/O in POV-Ray, so perhaps someone can correct me 
if I'm wrong.

Rune
-- 
http://runevision.com


Post a reply to this message

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