POV-Ray : Newsgroups : povray.newusers : volume rendering from a text file containing positions in 3 dimensions : Re: volume rendering from a text file containing positions in 3 dimensions Server Time
7 Jul 2024 08:02:08 EDT (-0400)
  Re: volume rendering from a text file containing positions in 3 dimensions  
From: Simon
Date: 12 Mar 2010 17:17:52
Message: <4b9abd90$1@news.povray.org>
Hi anki,

> i have a txt file containing spherical particle positions (x,y and z) and i want
> to produce a 3 -dimensional image from this txt file

POV is quite specific in what it will read in. You really need the data 
in CSV format:

x1,y1,z1,x2,y2,z2

To get a handle on the file, do this:
#fopen IDENTIFIER "filename" read

Then to read the next value(s) from a CSV, do this:
#read (IDENTIFIER, PosX, PosY, PosZ)

You now have the first 3 values in the variables PosX, PosY and PosZ

You'll also need to look at #while() to handle looping through the file

>
> i just started using POV Ray today and i think we need to produce two files with
> extension *.ini and *.pov from the text file of positions

The POV file defines the scene and the INI file is used to provide 
additional information (eg, How many frames to render in an animation, 
what file type to output, etc...)

My default INI file is:

==========================================================
Initial_Frame=0	;Start at frame 0
Final_Frame=100	;End at frame 100
Initial_Clock=0	;The variable "clock" will change from 0
Final_Clock=1	;to 1 ovr the course of the animation

;Frame Subset: This is done so you can render a couple of frames from an 
animation without altering the clock variable above
;Subset_Start_Frame = 100	;start at this frame
;Subset_End_Frame = 1439	;end at this frame

Input_File_Name=Scene.pov ;The POV file to render (usually in same 
directory)

Output_to_File=on	;Write out to file after rendering?
Output_File_Name= Frame	;The name of the file eg Frame0000.png

Cyclic_Animation=on ;Offset the end of the animation slightly so that a 
cyclic animation doesn't "jerk" as it loops through frame 0
==========================================================
Most of these have command line switches - See the help for more info


Hope that helps a bit


Post a reply to this message

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