POV-Ray : Newsgroups : povray.pov4.discussion.general : Request for *.df4 format (ASCII text based) : Re: Request for *.df4 format (ASCII text based) Server Time
2 Jun 2024 02:56:16 EDT (-0400)
  Re: Request for *.df4 format (ASCII text based)  
From: clipka
Date: 27 Aug 2010 07:32:09
Message: <4c77a239@news.povray.org>
Am 27.08.2010 12:35, schrieb bapt:

> Is there somewhere I could find a minimal example of what I should export as a
> density file, some specification of what coordinates and values I should use to
> see something within my box?

> I'm using R to create a table of values, with the following script
>
> N<- 100
> xx<- seq(0,1, length=N)
> d<- expand.grid(x=xx,y=xx,z=xx)
> d$t<- runif(nrow(d), 0, 255) # random values
>
> cat(file="data.dat", "1 1 1\n")
> write.table(d,file="data.dat",row.names = F,
>              col.names = F,append=T)

I'm sorry, I have no idea what "R" is.

To make sure what I told you would indeed to the trick, I generated a 
sample density file by adding the following additional statements at the 
beginning of the scene file you provided:

   #include "arrays.inc"

   #declare A = array[2][2][2] {
     { { 0.1, 0.2 }, { 0.3, 0.4 } },
     { { 0.5, 0.6 }, { 0.7, 0.8 } }
   }

   ARRAYS_WriteDF3(A, "data.df3", 8)

(using POV-Ray 3.7 beta 38; it won't work with POV-Ray 3.6)

This would correspond to a 2x2x2 grid, with cells filled as follows:

   0,0,0   26
   0,0,1   51
   0,1,0	  77
   0,1,1  102
   1,0,0  153
   1,0,1  179
   1,1,0  204

This does work - for example - with absorption <1,1,1>*30 on a white 
background, or emission<1,1,1>*10 on a black background.

If you still can't get this to work, then something's broken in your 
workflow. Otherwise, you're just still too cautious about the absorption 
values to get your own density files working. Be bold to try out some 
insanely large values - you can't physically break anything ;-)


Post a reply to this message

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