POV-Ray : Newsgroups : povray.newusers : Reading data from a file Server Time
4 Sep 2024 16:12:45 EDT (-0400)
  Reading data from a file (Message 1 to 2 of 2)  
From: Simon de Vet
Subject: Reading data from a file
Date: 4 Oct 2002 13:03:12
Message: <3D9DC91C.4040806@is2.dal.ca>
I have a nice long file, in the format:

-1.000000E+01 -1.000000E+01 -1.000000E+01 1 1 0
-1.000000E+01 -1.000000E+01 -9.000000E+00 1 1 0
-1.000000E+01 -1.000000E+01 -8.000000E+00 1 1 0
-1.000000E+01 -1.000000E+01 -7.000000E+00 1 1 0
-1.000000E+01 -1.000000E+01 -6.000000E+00 0 1 -1
-1.000000E+01 -1.000000E+01 -5.000000E+00 0 1 -1
-1.000000E+01 -1.000000E+01 -4.000000E+00 0 1 -1


The first three columns are x, y, and z coordinates. The next three are 
data associated with the coordinates (to be represented as colour, size, 
etc..)

I haven't had much luck loading these into PovRay. Pov seems to want 
comma separated numbers, but this isn't feasable. I tried loading the 
numbers in one at a time with:

#read (datafile,buffer)

Then output them with:

#debug str(buffer,0,1)

but it seems to loose negative signs and get generally confused.

Any suggestions?

-- Simon


Post a reply to this message

From: Warp
Subject: Re: Reading data from a file
Date: 4 Oct 2002 14:36:06
Message: <3d9ddf95@news.povray.org>
Simon de Vet <sde### [at] is2dalca> wrote:
> I have a nice long file, in the format:

> -1.000000E+01 -1.000000E+01 -1.000000E+01 1 1 0

> I haven't had much luck loading these into PovRay. Pov seems to want 
> comma separated numbers, but this isn't feasable.

  Why not?

  If you want to add the commas, you can use any editor with
search&replace and replace the whitespaces with commas.

> but it seems to loose negative signs and get generally confused.

  -something -something -something is a substraction and POV-Ray probably
reads it as such.

-- 
#macro N(D)#if(D>99)cylinder{M()#local D=div(D,104);M().5,2pigment{rgb M()}}
N(D)#end#end#macro M()<mod(D,13)-6mod(div(D,13)8)-3,10>#end blob{
N(11117333955)N(4254934330)N(3900569407)N(7382340)N(3358)N(970)}//  - Warp -


Post a reply to this message

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