POV-Ray : Newsgroups : povray.programming : Parse a ascii param file for particle process Server Time
29 Jul 2024 02:34:58 EDT (-0400)
  Parse a ascii param file for particle process (Message 1 to 2 of 2)  
From: Oliver Schmitt
Subject: Parse a ascii param file for particle process
Date: 26 Oct 1998 14:52:35
Message: <3634E0F2.A02143AC@anat.mu-luebeck.de>
Hi,

I have to parse large ASCII files that contain parameters for thousands
of spheres and their textures.
Such a ASCII file has a structure like

X   Y    Z     SIZE  COLOR
0.9 0.7  0.1  0.05  BLUE
0.8 0.6  0.1  0.03  YELLOW
....

Does anybody know how to parse such a file within a POVRAY script?

Another question, is there anywhere an example of how to store a
rendered image as a *.tif file?


Thanks a lot.    Oliver



--
MUL-Anatomy
Dr. Oliver Schmitt
Ratzeburger Allee 160

D-23538 Luebeck

Phone:
Office: ++49 451 500 4041
Image Lab 1: ++49 451 500 4640
Image Lab 2: ++49 451 500 4008
GS-Lab: ++49 451 500 4019
Secretary: ++49 451 500 4031

Fax: ++49 451 500 4034

You will find me in:
Buildung: 63
Room: 112

URL: http://www.anat.mu-luebeck.de/schmitt.html


Post a reply to this message

From: Wayne Gordon
Subject: Re: Parse a ascii param file for particle process
Date: 26 Oct 1998 16:38:24
Message: <3634ECC5.313E@phoenix.net>
Oliver Schmitt wrote:
> 
> Hi,
> 
> I have to parse large ASCII files that contain parameters for thousands
> of spheres and their textures.
> Such a ASCII file has a structure like
> 
> X   Y    Z     SIZE  COLOR
> 0.9 0.7  0.1  0.05  BLUE
> 0.8 0.6  0.1  0.03  YELLOW
> ....
> 
> Does anybody know how to parse such a file within a POVRAY script?

Pov 3.1 has file I/O capabilities, so this would be no problem
provided that you first formatted the data to adhere to the 
requirements you can read about in the help docs. I'd suggest a simple
external program to reformat the data such that each X Y Z can
be read as a single vector <X,Y,Z>, size would be a single float
and the color should be an (RGB) vector so....

X    Y    Z    SIZE    COLOR
0.9  0.7  0.1  0.05    Blue

would become....

XYZ          SIZE     COLOR
<.9,.7,.1>,   .05,    <0,0,1>,
...
...

Note that all data elements must be seperated by a comma.
Check the docs for more info.

> 
> Another question, is there anywhere an example of how to store a
> rendered image as a *.tif file?
> 
> Thanks a lot.    Oliver
> 
> --
> MUL-Anatomy
> Dr. Oliver Schmitt
> Ratzeburger Allee 160
> 
> D-23538 Luebeck
> 
> Phone:
> Office: ++49 451 500 4041
> Image Lab 1: ++49 451 500 4640
> Image Lab 2: ++49 451 500 4008
> GS-Lab: ++49 451 500 4019
> Secretary: ++49 451 500 4031
> 
> Fax: ++49 451 500 4034
> 
> You will find me in:
> Buildung: 63
> Room: 112
> 
> URL: http://www.anat.mu-luebeck.de/schmitt.html


Post a reply to this message

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