Data File Input in POVRay?

Data File Input in POVRay?

Post by Ken » Fri, 13 Oct 2000 04:00:00




> Hi,

> Ive got a question regarding a data file input in POVRay:

> I have 3D-coordinates in a file which looks like this:

> x1   y1   z1
> x2   y2   z2
> .
> .
> .
> xn   yn   zn

> n~10,000.

> I now would like to use this set of coordinates to place a small sphere
> on every
> coordinate, and of course I dont want to input the data via keyboard.
> :-)

> What is the best way to implement the file? I havent found anything in
> the FAQ on this topic...

> Ciao,
> MB

Probably the easiest way would be to read the data into an array
and then pass the array to a while loop to position the spheres.
That's how I would do it anyway.

--
Ken Tyler

 
 
 

Data File Input in POVRay?

Post by Michael Bertschi » Sat, 14 Oct 2000 07:10:38


Hi,

Ive got a question regarding a data file input in POVRay:

I have 3D-coordinates in a file which looks like this:

x1   y1   z1
x2   y2   z2
.
.
.
xn   yn   zn

n~10,000.

I now would like to use this set of coordinates to place a small sphere
on every
coordinate, and of course I dont want to input the data via keyboard.
:-)

What is the best way to implement the file? I havent found anything in
the FAQ on this topic...

Ciao,
MB

 
 
 

Data File Input in POVRay?

Post by ing » Sat, 14 Oct 2000 04:00:00



>x1   y1   z1
>x2   y2   z2
>.
>xn   yn   zn

>I now would like to use this set of coordinates to place a small sphere
>on every
>coordinate, and of course I dont want to input the data via keyboard.

Separate your data with comma's:

#fopen Coords "Data.txt" read
#while (defined(Coords))
  #read (MyFile,Cx,Cy,Cz)
  sphere{<Cx,Cy,Cz>,1}
#end

Look for the read_directive in the docs.

Ingo

--
Photography: http://members.home.nl/ingoogni/
Pov-Ray    : http://members.home.nl/seed7/

 
 
 

Data File Input in POVRay?

Post by Michael Bertschi » Mon, 16 Oct 2000 07:07:58


Hi,

Thanks so far for your answers. I will try to figure it out.

Ciao,
MB

 
 
 

Data File Input in POVRay?

Post by PoD » Mon, 16 Oct 2000 08:38:37




> >x1   y1   z1
> >x2   y2   z2

> >.
> >xn   yn   zn

> >I now would like to use this set of coordinates to place a small sphere
> >on every
> >coordinate, and of course I dont want to input the data via keyboard.

> Separate your data with comma's:

> #fopen Coords "Data.txt" read
> #while (defined(Coords))
>   #read (MyFile,Cx,Cy,Cz)
>   sphere{<Cx,Cy,Cz>,1}
> #end

> Look for the read_directive in the docs.

> Ingo

If you convert your data file to the form

<x1,y1,z1>,
<x2,y2,z2>,
...

then do

#fopen Coords "Data.txt" read
#while (defined(Coords))
#read (MyFile,P)
sphere{P,1}
#end

it might parse faster.

PoD.

 
 
 

1. PovRay: using input data from a file

I have an input file with 4 numbers on each line: 3 coordinates and a
radius. Now I want to represent all these spheres using PovRay. Can this
be done using a loop
... sphere{<x,y,z},r}... where at each step x, y, z and r are replaced
by the corresponding numbers in the input file?

delete NOSPAM when answering by e-mail
--
Herman SERRAS
University of Gent

2. CMYK under gimp....

3. Inputting data file to plot !!

4. CGI2000, revised call for paper

5. How transpose input data file?

6. Actors and Props

7. Timestamped input data files

8. gnuplot capability to manupulate input file data prior to plotting

9. Can I input an object in a lwo file to another lwo file

10. Question concerning input a gnuplot file to LaTex file

11. MegaPOV Isosurface "i_dat3d" (input data)

12. 3d data input device